chore(project): 删除项目中的所有文件
- 移除 .gitignore 配置文件 - 删除 Prettier 配置文件 - 删除 AdminApplications.vue 管理员应用页面组件 - 移除 API 服务配置文件 - 删除 App.vue 根组件 - 移除 applicationController API 接口定义 - 删除 bossApplicationDecisionController 决策控制器 - 移除 BossApplications.vue 招聘方应用页面 - 删除 BossCompany.vue 公司管理页面 - 移除 bossController API 控制器 - 删除 Bosses.vue 招聘方列表页面 - 移除 companyController 公司控制器 - 删除 Pinia 计数器存储 - 移除环境类型定义文件 - 删除 VSCode 扩展推荐配置 - 清空 HomeView.vue 首页组件
This commit is contained in:
@@ -15,6 +15,7 @@ import com.zds.boss.exception.BusinessException;
|
|||||||
import com.zds.boss.exception.ErrorCode;
|
import com.zds.boss.exception.ErrorCode;
|
||||||
import com.zds.boss.exception.ThrowUtils;
|
import com.zds.boss.exception.ThrowUtils;
|
||||||
import com.zds.boss.model.dto.user.UserLoginRequest;
|
import com.zds.boss.model.dto.user.UserLoginRequest;
|
||||||
|
import com.zds.boss.model.dto.user.UserProfileUpdateRequest;
|
||||||
import com.zds.boss.model.dto.user.UserQueryRequest;
|
import com.zds.boss.model.dto.user.UserQueryRequest;
|
||||||
import com.zds.boss.model.dto.user.UserRegisterRequest;
|
import com.zds.boss.model.dto.user.UserRegisterRequest;
|
||||||
import com.zds.boss.model.dto.user.UserUpdateRequest;
|
import com.zds.boss.model.dto.user.UserUpdateRequest;
|
||||||
@@ -156,6 +157,54 @@ public class UserController {
|
|||||||
return ResultUtils.success(true);
|
return ResultUtils.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/update/profile")
|
||||||
|
public BaseResponse<Boolean> updateUserProfile(@RequestBody UserProfileUpdateRequest updateRequest, HttpServletRequest request) {
|
||||||
|
ThrowUtils.throwIf(updateRequest == null, ErrorCode.PARAMS_ERROR);
|
||||||
|
|
||||||
|
User loginUser = userService.getLoginUser(request);
|
||||||
|
boolean isAdmin = UserRoleEnum.ADMIN.getValue().equals(loginUser.getUserRole());
|
||||||
|
|
||||||
|
Long targetUserId = loginUser.getId();
|
||||||
|
if (isAdmin && updateRequest.getId() != null && updateRequest.getId() > 0) {
|
||||||
|
targetUserId = updateRequest.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
User targetUser = userService.getById(targetUserId);
|
||||||
|
ThrowUtils.throwIf(targetUser == null, ErrorCode.NOT_FOUND_ERROR);
|
||||||
|
|
||||||
|
User userToUpdate = new User();
|
||||||
|
userToUpdate.setId(targetUserId);
|
||||||
|
|
||||||
|
if (updateRequest.getPhone() != null) {
|
||||||
|
userToUpdate.setPhone(updateRequest.getPhone());
|
||||||
|
}
|
||||||
|
if (updateRequest.getEmail() != null) {
|
||||||
|
userToUpdate.setEmail(updateRequest.getEmail());
|
||||||
|
}
|
||||||
|
if (updateRequest.getUserProfile() != null) {
|
||||||
|
userToUpdate.setUserProfile(updateRequest.getUserProfile());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updateRequest.getUserPassword() != null) {
|
||||||
|
String newPassword = updateRequest.getUserPassword();
|
||||||
|
if (newPassword.length() < 8 || newPassword.length() > 15) {
|
||||||
|
throw new BusinessException(ErrorCode.PARAMS_ERROR, "用户密码长度应为 8-15 位");
|
||||||
|
}
|
||||||
|
if (!isAdmin) {
|
||||||
|
ThrowUtils.throwIf(updateRequest.getOldPassword() == null, ErrorCode.PARAMS_ERROR, "旧密码不能为空");
|
||||||
|
String oldPasswordEncrypt = userService.getEncryptPassword(updateRequest.getOldPassword());
|
||||||
|
if (!oldPasswordEncrypt.equals(targetUser.getUserPassword())) {
|
||||||
|
throw new BusinessException(ErrorCode.PARAMS_ERROR, "旧密码错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
userToUpdate.setUserPassword(userService.getEncryptPassword(newPassword));
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean result = userService.updateById(userToUpdate);
|
||||||
|
ThrowUtils.throwIf(!result, ErrorCode.OPERATION_ERROR);
|
||||||
|
return ResultUtils.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页获取用户封装列表
|
* 分页获取用户封装列表
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,8 +1,89 @@
|
|||||||
package com.zds.boss.mapper;
|
package com.zds.boss.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.zds.boss.model.dto.application.ApplicationQueryRequest;
|
||||||
import com.zds.boss.model.entity.Application;
|
import com.zds.boss.model.entity.Application;
|
||||||
|
import com.zds.boss.model.vo.ApplicationVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
public interface ApplicationMapper extends BaseMapper<Application> {
|
public interface ApplicationMapper extends BaseMapper<Application> {
|
||||||
|
|
||||||
|
@Select("""
|
||||||
|
<script>
|
||||||
|
select
|
||||||
|
a.id,
|
||||||
|
a.user_id as userId,
|
||||||
|
u.username as userName,
|
||||||
|
a.resume_id as resumeId,
|
||||||
|
a.job_id as jobId,
|
||||||
|
a.boss_id as bossId,
|
||||||
|
a.status,
|
||||||
|
a.applied_at as appliedAt,
|
||||||
|
a.updated_at as updatedAt
|
||||||
|
from application a
|
||||||
|
left join user u on u.id = a.user_id
|
||||||
|
<where>
|
||||||
|
<if test="query != null and query.id != null">
|
||||||
|
and a.id = #{query.id}
|
||||||
|
</if>
|
||||||
|
<if test="query != null and query.userId != null">
|
||||||
|
and a.user_id = #{query.userId}
|
||||||
|
</if>
|
||||||
|
<if test="query != null and query.resumeId != null">
|
||||||
|
and a.resume_id = #{query.resumeId}
|
||||||
|
</if>
|
||||||
|
<if test="query != null and query.jobId != null">
|
||||||
|
and a.job_id = #{query.jobId}
|
||||||
|
</if>
|
||||||
|
<if test="query != null and query.bossId != null">
|
||||||
|
and a.boss_id = #{query.bossId}
|
||||||
|
</if>
|
||||||
|
<if test="query != null and query.status != null">
|
||||||
|
and a.status = #{query.status}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
<choose>
|
||||||
|
<when test="query != null and query.sortField != null and (query.sortField == 'id' or query.sortField == 'a.id')">
|
||||||
|
order by a.id
|
||||||
|
</when>
|
||||||
|
<when test="query != null and query.sortField != null and (query.sortField == 'userId' or query.sortField == 'user_id' or query.sortField == 'a.user_id')">
|
||||||
|
order by a.user_id
|
||||||
|
</when>
|
||||||
|
<when test="query != null and query.sortField != null and (query.sortField == 'resumeId' or query.sortField == 'resume_id' or query.sortField == 'a.resume_id')">
|
||||||
|
order by a.resume_id
|
||||||
|
</when>
|
||||||
|
<when test="query != null and query.sortField != null and (query.sortField == 'jobId' or query.sortField == 'job_id' or query.sortField == 'a.job_id')">
|
||||||
|
order by a.job_id
|
||||||
|
</when>
|
||||||
|
<when test="query != null and query.sortField != null and (query.sortField == 'bossId' or query.sortField == 'boss_id' or query.sortField == 'a.boss_id')">
|
||||||
|
order by a.boss_id
|
||||||
|
</when>
|
||||||
|
<when test="query != null and query.sortField != null and (query.sortField == 'status' or query.sortField == 'a.status')">
|
||||||
|
order by a.status
|
||||||
|
</when>
|
||||||
|
<when test="query != null and query.sortField != null and (query.sortField == 'appliedAt' or query.sortField == 'applied_at' or query.sortField == 'a.applied_at')">
|
||||||
|
order by a.applied_at
|
||||||
|
</when>
|
||||||
|
<when test="query != null and query.sortField != null and (query.sortField == 'updatedAt' or query.sortField == 'updated_at' or query.sortField == 'a.updated_at')">
|
||||||
|
order by a.updated_at
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
order by a.applied_at
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
<choose>
|
||||||
|
<when test="query != null and query.sortOrder != null and query.sortOrder == 'ascend'">
|
||||||
|
asc
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</script>
|
||||||
|
""")
|
||||||
|
IPage<ApplicationVO> selectApplicationVOByPage(Page<ApplicationVO> page, @Param("query") ApplicationQueryRequest query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.zds.boss.model.dto.user;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class UserProfileUpdateRequest implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String oldPassword;
|
||||||
|
|
||||||
|
private String userPassword;
|
||||||
|
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
private String userProfile;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -8,6 +8,7 @@ import java.util.Date;
|
|||||||
public class ApplicationVO implements Serializable {
|
public class ApplicationVO implements Serializable {
|
||||||
private Long id;
|
private Long id;
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
private String userName;
|
||||||
private Long resumeId;
|
private Long resumeId;
|
||||||
private Long jobId;
|
private Long jobId;
|
||||||
private Long bossId;
|
private Long bossId;
|
||||||
|
|||||||
@@ -190,9 +190,8 @@ public class ApplicationServiceImpl extends ServiceImpl<ApplicationMapper, Appli
|
|||||||
public Page<ApplicationVO> listApplicationVOByPage(ApplicationQueryRequest query) {
|
public Page<ApplicationVO> listApplicationVOByPage(ApplicationQueryRequest query) {
|
||||||
long current = query.getCurrent();
|
long current = query.getCurrent();
|
||||||
long size = query.getPageSize();
|
long size = query.getPageSize();
|
||||||
Page<Application> page = this.page(new Page<>(current, size), getQueryWrapper(query));
|
Page<ApplicationVO> voPage = new Page<>(current, size);
|
||||||
Page<ApplicationVO> voPage = new Page<>(current, size, page.getTotal());
|
this.baseMapper.selectApplicationVOByPage(voPage, query);
|
||||||
voPage.setRecords(getApplicationVOList(page.getRecords()));
|
|
||||||
return voPage;
|
return voPage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const __dirname = dirname(__filename);
|
|||||||
// 生成 API 服务代码
|
// 生成 API 服务代码
|
||||||
generateService({
|
generateService({
|
||||||
requestLibPath: "import request from '@/libs/request'",
|
requestLibPath: "import request from '@/libs/request'",
|
||||||
schemaPath: 'http://localhost:8082/v3/api-docs',
|
schemaPath: 'http://localhost:8081/v3/api-docs',
|
||||||
serversPath: join(__dirname, 'src/api'),
|
serversPath: join(__dirname, 'src/api'),
|
||||||
mock: false,
|
mock: false,
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
// @ts-ignore
|
|
||||||
/* eslint-disable */
|
|
||||||
import request from '@/libs/request'
|
|
||||||
|
|
||||||
export async function uploadResumePdf(formData: FormData, options?: { [key: string]: any }) {
|
|
||||||
return request<any>('/resume/address/upload', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'multipart/form-data',
|
|
||||||
},
|
|
||||||
data: formData,
|
|
||||||
...(options || {}),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getMyResumeAddress(options?: { [key: string]: any }) {
|
|
||||||
return request<any>('/resume/address/get', {
|
|
||||||
method: 'GET',
|
|
||||||
...(options || {}),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function deleteMyResumeAddress(body: API.DeleteRequest, options?: { [key: string]: any }) {
|
|
||||||
return request<any>('/resume/address/delete', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -71,14 +71,14 @@ export async function updateResume(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 上传简历附件文件 POST /resume/upload */
|
/** 此处后端没有提供注释 POST /resume/upload */
|
||||||
export async function uploadResumeFile(
|
export async function uploadFile(body: {}, options?: { [key: string]: any }) {
|
||||||
formData: FormData,
|
|
||||||
options?: { [key: string]: any }
|
|
||||||
) {
|
|
||||||
return request<API.BaseResponseString>('/resume/upload', {
|
return request<API.BaseResponseString>('/resume/upload', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: formData,
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
data: body,
|
||||||
...(options || {}),
|
...(options || {}),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
22
BOSSFrontEnd/src/api/api/typings.d.ts
vendored
22
BOSSFrontEnd/src/api/api/typings.d.ts
vendored
@@ -39,6 +39,7 @@ declare namespace API {
|
|||||||
type ApplicationVO = {
|
type ApplicationVO = {
|
||||||
id?: number
|
id?: number
|
||||||
userId?: number
|
userId?: number
|
||||||
|
userName?: string
|
||||||
resumeId?: number
|
resumeId?: number
|
||||||
jobId?: number
|
jobId?: number
|
||||||
bossId?: number
|
bossId?: number
|
||||||
@@ -131,12 +132,6 @@ declare namespace API {
|
|||||||
message?: string
|
message?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
type BaseResponseString = {
|
|
||||||
code?: number
|
|
||||||
data?: string
|
|
||||||
message?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
type BaseResponsePageApplicationVO = {
|
type BaseResponsePageApplicationVO = {
|
||||||
code?: number
|
code?: number
|
||||||
data?: PageApplicationVO
|
data?: PageApplicationVO
|
||||||
@@ -185,6 +180,12 @@ declare namespace API {
|
|||||||
message?: string
|
message?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type BaseResponseString = {
|
||||||
|
code?: number
|
||||||
|
data?: string
|
||||||
|
message?: string
|
||||||
|
}
|
||||||
|
|
||||||
type BaseResponseUser = {
|
type BaseResponseUser = {
|
||||||
code?: number
|
code?: number
|
||||||
data?: User
|
data?: User
|
||||||
@@ -673,6 +674,15 @@ declare namespace API {
|
|||||||
userPassword?: string
|
userPassword?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type UserProfileUpdateRequest = {
|
||||||
|
id?: number
|
||||||
|
oldPassword?: string
|
||||||
|
userPassword?: string
|
||||||
|
email?: string
|
||||||
|
phone?: string
|
||||||
|
userProfile?: string
|
||||||
|
}
|
||||||
|
|
||||||
type UserQueryRequest = {
|
type UserQueryRequest = {
|
||||||
current?: number
|
current?: number
|
||||||
pageSize?: number
|
pageSize?: number
|
||||||
|
|||||||
@@ -121,3 +121,18 @@ export async function updateUser(body: API.UserUpdateRequest, options?: { [key:
|
|||||||
...(options || {}),
|
...(options || {}),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 此处后端没有提供注释 POST /user/update/profile */
|
||||||
|
export async function updateUserProfile(
|
||||||
|
body: API.UserProfileUpdateRequest,
|
||||||
|
options?: { [key: string]: any }
|
||||||
|
) {
|
||||||
|
return request<API.BaseResponseBoolean>('/user/update/profile', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
data: body,
|
||||||
|
...(options || {}),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -76,9 +76,9 @@ const columns = [
|
|||||||
key: 'jobId',
|
key: 'jobId',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '申请人ID',
|
title: '申请人',
|
||||||
dataIndex: 'userId',
|
dataIndex: 'userName',
|
||||||
key: 'userId',
|
key: 'userName',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '投递时间',
|
title: '投递时间',
|
||||||
|
|||||||
@@ -10,9 +10,6 @@
|
|||||||
:label-col="{ span: 4 }"
|
:label-col="{ span: 4 }"
|
||||||
:wrapper-col="{ span: 12 }"
|
:wrapper-col="{ span: 12 }"
|
||||||
>
|
>
|
||||||
<a-form-item label="ID">
|
|
||||||
<a-input v-model:value="formState.id" disabled />
|
|
||||||
</a-form-item>
|
|
||||||
|
|
||||||
<a-form-item label="用户名/账号">
|
<a-form-item label="用户名/账号">
|
||||||
<a-input v-model:value="formState.username" disabled />
|
<a-input v-model:value="formState.username" disabled />
|
||||||
@@ -27,11 +24,11 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item label="电话">
|
<a-form-item label="电话">
|
||||||
<a-input v-model:value="formState.phone" disabled placeholder="暂不支持修改" />
|
<a-input v-model:value="formState.phone" placeholder="156xxxx" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item label="邮箱">
|
<a-form-item label="邮箱">
|
||||||
<a-input v-model:value="formState.email" disabled placeholder="暂不支持修改" />
|
<a-input v-model:value="formState.email" placeholder="xxx@cc.com" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item :wrapper-col="{ offset: 4, span: 12 }">
|
<a-form-item :wrapper-col="{ offset: 4, span: 12 }">
|
||||||
|
|||||||
Reference in New Issue
Block a user