提交 991db5a5 authored 作者: LJJ's avatar LJJ

修改user模块

上级 3f6defea
package com.zjty.efs.user.subject.controller;
import com.zjty.efs.misc.config.AutoDocument;
import com.zjty.efs.user.subject.entity.User;
import com.zjty.efs.user.subject.entity.UserDo;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
* @author LJJ cnljj1995@gmail.com
......@@ -17,15 +18,38 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/api")
@AutoDocument
@Api(tags = "用户模块接口")
@Slf4j
public class UserController {
@GetMapping
@GetMapping("/user")
@ApiOperation(value = "查询用户的接口")
@ApiImplicitParams({
@ApiImplicitParam(name="id",value="人员id",dataType="Integer", paramType = "int",required = true)
@ApiImplicitParam(name="id",value="id",dataType="string", paramType = "query")
})
public ResponseEntity<UserDo> getUserById(@RequestParam(value = "id") String id) {
log.info("查询id:{}", id);
return ResponseEntity.ok(new UserDo());
}
@GetMapping("/otherUser")
@ApiOperation(value = "获取相关人员信息接口")
@ApiImplicitParams({
@ApiImplicitParam(name="id",value="人员id",dataType="string", paramType = "query")
})
public ResponseEntity<User> getUserById(@RequestParam Integer id) {
public ResponseEntity<List<UserDo>> getAllUser(@RequestParam(value = "id") String id) {
List<UserDo> list = new ArrayList<>();
list.add(new UserDo());
return ResponseEntity.ok(list);
}
return ResponseEntity.ok(new User());
@PutMapping("/reset")
@ApiOperation(value = "重置用户密码")
@ApiImplicitParams({
@ApiImplicitParam(name="id",value="人员id",dataType="string", paramType = "query")
})
public ResponseEntity resetStatus(@RequestParam(value = "id") String id) {
return ResponseEntity.ok(true);
}
}
package com.zjty.efs.user.subject.dao;
import com.zjty.efs.user.subject.entity.User;
import com.zjty.efs.user.subject.entity.UserDo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
......@@ -9,5 +9,5 @@ import org.springframework.stereotype.Repository;
* on 2020-03-24
*/
@Repository
public interface UserDao extends JpaRepository<User, Integer> {
public interface UserDao extends JpaRepository<UserDo, Integer> {
}
......@@ -28,7 +28,7 @@ import java.util.List;
@AutoDocument
@ApiModel(value = "用户", description = "用户实体类")
@Table(name = "user")
public class User {
public class UserDo {
@ApiModelProperty(value = "id",example = "jksdhfjks5")
@Id
......@@ -38,14 +38,6 @@ public class User {
@ApiModelProperty(value = "用户姓名",example = "mcj")
private String name;
@NotNull(message = "岗位不可为空")
@ApiModelProperty(value = "岗位",example = "1")
private String job;
@NotEmpty(message = "身份证号码不可为空")
@ApiModelProperty(value = "身份证",example = "48489498131566546")
private String idCard;
@NotEmpty(message = "联系方式不可为空")
@ApiModelProperty(value = "联系方式",example = "113665465465")
private String tel;
......@@ -54,19 +46,10 @@ public class User {
@ApiModelProperty(value = "地址",example = "xx路xx楼xx号")
private String address;
@NotNull(message = "到岗时间不可为空")
@ApiModelProperty(value = "到岗时间",example = "2019-01-45 12:12:12")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date insertTime;
@NotNull(message = "部门不可为空")
@ApiModelProperty(value = "部门id",example = "1")
private String departId;
@NotNull(message = "性别不可为空")
@ApiModelProperty(value = "性别,0_男,1_女",example = "1")
private Integer sex;
@ApiModelProperty(value = "备注",example = "dadsd")
private String remark;
......@@ -74,6 +57,9 @@ public class User {
@ApiModelProperty(value = "用户名",example = "username")
private String username;
@ApiModelProperty(value = "处室", example = "秘书处")
private String department;
@NotEmpty(message = "密码不可为空")
@ApiModelProperty(value = "密码",example = "password")
private String password;
......@@ -82,4 +68,7 @@ public class User {
@ApiModelProperty(value = "用户锁定状态,0_未锁定,1_已锁定",example = "1")
private Integer status;
@ApiModelProperty(value = "数据更新时间", example = "2019-01-01 00:00:00.000")
private Date updateTime;
}
package com.zjty.efs.user.subject.service;
import com.sun.tools.corba.se.idl.InterfaceGen;
import com.zjty.efs.user.subject.entity.User;
import com.zjty.efs.user.subject.entity.UserDo;
import java.util.List;
......@@ -18,13 +17,13 @@ public interface UserService {
* @param id user id
* @return user obj
*/
User findById(Integer id);
UserDo findById(Integer id);
/**
* 查找所用用户,除了管理员
* @return users obj
*/
List<User> findAllUser();
List<UserDo> findAllUser();
/**
* 更新人员状态
......@@ -39,7 +38,7 @@ public interface UserService {
* @param id 人员id
* @return users obj
*/
List<User> getAllowAckUser(Integer id);
List<UserDo> getAllowAckUser(Integer id);
/**
* 重置密码
......@@ -51,10 +50,10 @@ public interface UserService {
/**
* 创建用户
* @param user 用户对象
* @param userDo 用户对象
* @return true or false
*/
Boolean addUser(User user);
Boolean addUser(UserDo userDo);
......
package com.zjty.efs.user.subject.service.impl;
import com.zjty.efs.user.subject.entity.User;
import com.zjty.efs.user.subject.entity.UserDo;
import com.zjty.efs.user.subject.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
......@@ -16,13 +16,13 @@ import java.util.List;
public class UserServiceImpl implements UserService {
@Override
public User findById(Integer id) {
public UserDo findById(Integer id) {
return null;
}
@Override
public List<User> findAllUser() {
public List<UserDo> findAllUser() {
return null;
}
......@@ -32,7 +32,7 @@ public class UserServiceImpl implements UserService {
}
@Override
public List<User> getAllowAckUser(Integer id) {
public List<UserDo> getAllowAckUser(Integer id) {
return null;
}
......@@ -42,7 +42,7 @@ public class UserServiceImpl implements UserService {
}
@Override
public Boolean addUser(User user) {
public Boolean addUser(UserDo userDo) {
return null;
}
}
......@@ -13,7 +13,7 @@
<module>efs-misc</module>
<module>efs-ftp</module>
<module>efs-bus</module>
<module>efs-user</module>
<module>efs-userDo</module>
</modules>
......
......@@ -16,6 +16,6 @@
| ftp服务 | efs-ftp | 张爽 | |
| 业务 | efs-bus | | |
| 消息提醒 | efs-msg | | |
| 用户管理 | efs-user | | |
| 用户管理 | efs-userDo | | |
| | | | |
| | | | |
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论