接口文档

cert
schry 2 years ago
parent 8e86b27ad3
commit 886faede31

@ -4,6 +4,8 @@ import java.util.List;
import javax.annotation.Resource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -23,6 +25,7 @@ import com.glxp.api.service.auth.DeptUserService;
import com.glxp.api.service.auth.WarehouseUserService;
import springfox.documentation.annotations.ApiIgnore;
@Api(tags = "部门用户相关接口")
@ApiIgnore
@RestController
public class DeptUserController {
@ -39,6 +42,7 @@ public class DeptUserController {
@AuthRuleAnnotation("")
@ApiOperation(value = "获取部门用户列表",response = DeptUserResponse.class)
@GetMapping("udi/auth/dept/user/filter")
public BaseResponse filterList(FilterDeptUserReqeust filterDeptUserReqeust) {
//获取部门id
@ -59,11 +63,10 @@ public class DeptUserController {
@AuthRuleAnnotation("")
@ApiOperation(value = "删除用户",response = BaseResponse.class)
@PostMapping("udi/auth/dept/user/delete")
public BaseResponse delete(@RequestBody DeptUserEntity deptUserEntity) {
//判断此用户是否与除一级部门 还绑定其他部门
FilterDeptUserReqeust filterDeptUserReqeust = new FilterDeptUserReqeust();
filterDeptUserReqeust.setUserId(deptUserEntity.getUserId());

@ -88,7 +88,7 @@ public class LoginController extends BaseController {
*
* @return
*/
@ApiOperation("系统用户登录")
@ApiOperation(value = "系统用户登录",response = LoginResponse.class)
@PostMapping(value = "/login")
public BaseResponse index(@RequestBody @Valid LoginRequest loginRequest,
BindingResult bindingResult,
@ -154,6 +154,7 @@ public class LoginController extends BaseController {
* @return
*/
@ApiIgnore
@ApiOperation(value = "用户pc端登入",response = BaseResponse.class)
@PostMapping(value = "/pc/login")
public BaseResponse pcLogin(@RequestBody @Valid PCLoginRequest loginRequest,
BindingResult bindingResult,
@ -223,6 +224,7 @@ public class LoginController extends BaseController {
@ApiIgnore
@AuthRuleAnnotation("")
@ApiOperation(value = "获取登入用户信息",response = LoginUserInfoResponse.class)
@GetMapping("/getInfo")
public BaseResponse getUserInfo(HttpServletRequest request) {
String adminId = request.getHeader("ADMIN_ID");

@ -2,17 +2,26 @@ package com.glxp.api.entity.auth;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel("部门用户实体")
@TableName("auth_dept_user")
public class DeptUserEntity {
@ApiModelProperty(value = "部门id")
@TableField("deptId")
private Long deptId;
@ApiModelProperty(value = "用户id")
@TableField("userId")
private Long userId;
@ApiModelProperty(value = "更新时间")
@TableField("updateTime")
private Date updateTime;

@ -1,12 +1,20 @@
package com.glxp.api.req.auth;
import com.glxp.api.util.page.ListPageRequest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("部门用户请求类")
public class FilterDeptUserReqeust extends ListPageRequest {
@ApiModelProperty(value = "部门id")
private Long deptId;
@ApiModelProperty(value = "用户id")
private Long userId;
@ApiModelProperty(value = "键")
private String key;
}

@ -1,5 +1,6 @@
package com.glxp.api.req.auth;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -9,6 +10,7 @@ import javax.validation.constraints.NotEmpty;
*
*/
@Data
@ApiModel("登录验证请求类")
public class LoginRequest {
@ApiModelProperty(value = "用户账号", required = true)
@ -19,7 +21,7 @@ public class LoginRequest {
@NotEmpty(message = "密码不能为空")
private String password;
@ApiModelProperty(value = "类型")
private Integer type;
private String imei;

@ -1,18 +1,24 @@
package com.glxp.api.req.auth;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
@Data
@ApiModel("PC端登入请求类")
public class PCLoginRequest {
@ApiModelProperty(value = "用户名")
@NotEmpty(message = "用户名不能为空")
private String username;
@ApiModelProperty(value = "密码")
@NotEmpty(message = "密码不能为空")
private String password;
@ApiModelProperty(value = "机器码")
@NotEmpty(message = "机器码不能为空")
private String machineInfo;

@ -1,18 +1,31 @@
package com.glxp.api.res.auth;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("部门用户响应类")
public class DeptUserResponse {
@ApiModelProperty(value = "部门id")
private Long deptId;
@ApiModelProperty(value = "用户id")
private Long userId;
@ApiModelProperty(value = "用户名")
private String userName;
@ApiModelProperty(value = "员工名称")
private String employeeName;
@ApiModelProperty(value = "部门名称")
private String deptName;
/**
*
*/
@ApiModelProperty(value = "备注")
private String comments;
}

@ -1,15 +1,23 @@
package com.glxp.api.res.auth;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("登入响应类")
public class LoginResponse {
@ApiModelProperty(value = "id")
private String id;
private String token;
@ApiModelProperty(value = "令牌")
private String token;
@ApiModelProperty(value = "部门")
private String dept;
@ApiModelProperty(value = "部门名称")
private String deptName;
}

Loading…
Cancel
Save