diff --git a/src/main/java/com/guaiguailang/harmony/controller/ActivateController.java b/src/main/java/com/guaiguailang/harmony/controller/ActivateController.java index 5c3d5c8..11124e4 100644 --- a/src/main/java/com/guaiguailang/harmony/controller/ActivateController.java +++ b/src/main/java/com/guaiguailang/harmony/controller/ActivateController.java @@ -89,4 +89,8 @@ public class ActivateController { public ResponseEntity detailActivate(@RequestBody ActivateUser au){ return ResponseEntity.ok(activateService.detailActivate(au)); } + @GetMapping("/my") + public ResponseEntity MyActivate(@RequestParam("uid") Long uid){ + return ResponseEntity.ok(activateService.myActivate(uid)); + } } diff --git a/src/main/java/com/guaiguailang/harmony/controller/AuthController.java b/src/main/java/com/guaiguailang/harmony/controller/AuthController.java index ef6806b..de05041 100644 --- a/src/main/java/com/guaiguailang/harmony/controller/AuthController.java +++ b/src/main/java/com/guaiguailang/harmony/controller/AuthController.java @@ -86,11 +86,11 @@ public class AuthController { description = "用户退出登录", tags = {"系统认证接口"} ) - @PostMapping("/logout") + @GetMapping("/logout") public ResponseEntity logout() { String id = StpUtil.getLoginId().toString(); StpUtil.logout(); - log.info("用户"+id+"退出"); + log.info("用户{}退出", id); return ResponseEntity.ok().build(); } @Operation( diff --git a/src/main/java/com/guaiguailang/harmony/domain/vo/ActivateUserVO.java b/src/main/java/com/guaiguailang/harmony/domain/vo/ActivateUserVO.java index bad93ff..394e66e 100644 --- a/src/main/java/com/guaiguailang/harmony/domain/vo/ActivateUserVO.java +++ b/src/main/java/com/guaiguailang/harmony/domain/vo/ActivateUserVO.java @@ -1,5 +1,6 @@ package com.guaiguailang.harmony.domain.vo; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; @Data @@ -12,5 +13,17 @@ public class ActivateUserVO { private long sf; private String about; private int status; - + private String title; + private String creatorName; + private long creatorId; + private String titleNext; + private String agentId; + private java.sql.Timestamp createTime; + private java.sql.Timestamp updateTime; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm") + private java.sql.Timestamp startTime; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm") + private java.sql.Timestamp endTime; + private String description; + private String imgUrl; } diff --git a/src/main/java/com/guaiguailang/harmony/mapper/ActivateMapper.java b/src/main/java/com/guaiguailang/harmony/mapper/ActivateMapper.java index 47ff8a7..30f5d3d 100644 --- a/src/main/java/com/guaiguailang/harmony/mapper/ActivateMapper.java +++ b/src/main/java/com/guaiguailang/harmony/mapper/ActivateMapper.java @@ -2,7 +2,7 @@ package com.guaiguailang.harmony.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.guaiguailang.harmony.domain.entity.ActiveBaseInfo; -import org.apache.ibatis.annotations.Insert; +import com.guaiguailang.harmony.domain.vo.ActivateUserVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; @@ -13,5 +13,6 @@ import java.util.List; public interface ActivateMapper extends BaseMapper { @Select("SELECT * FROM active_base_info WHERE ${paramName} != #{paramValue}") List getActivate(@Param("paramName") String paramName, @Param("paramValue") String paramValue); - +// @Select("SELECT * FROM active_base_info JOIN activate_user on active_base_info.id = activate_user.acid where activate_user.uid=#{uid}") + List getMyActivate(Long uid); } diff --git a/src/main/java/com/guaiguailang/harmony/service/ActivateService.java b/src/main/java/com/guaiguailang/harmony/service/ActivateService.java index 14db23a..bab64e0 100644 --- a/src/main/java/com/guaiguailang/harmony/service/ActivateService.java +++ b/src/main/java/com/guaiguailang/harmony/service/ActivateService.java @@ -28,4 +28,6 @@ public interface ActivateService { ResponseResult detailActivate(ActivateUser au); ResponseResult loadActivateSelect(ParamSelect paramSelect); + + ResponseResult myActivate(Long uid); } diff --git a/src/main/java/com/guaiguailang/harmony/service/impl/ActivateServiceImpl.java b/src/main/java/com/guaiguailang/harmony/service/impl/ActivateServiceImpl.java index e137334..22fc58e 100644 --- a/src/main/java/com/guaiguailang/harmony/service/impl/ActivateServiceImpl.java +++ b/src/main/java/com/guaiguailang/harmony/service/impl/ActivateServiceImpl.java @@ -215,4 +215,9 @@ public class ActivateServiceImpl implements ActivateService { public ResponseResult loadActivateSelect(ParamSelect paramSelect) { return ResponseResult.success(activateMapper.getActivate(paramSelect.getParamName(),paramSelect.getParamValue())); } + + @Override + public ResponseResult myActivate(Long uid) { + return ResponseResult.success(activateMapper.getMyActivate(uid)); + } } diff --git a/src/main/java/com/guaiguailang/harmony/service/impl/AuthServiceImpl.java b/src/main/java/com/guaiguailang/harmony/service/impl/AuthServiceImpl.java index 2a64a05..548fadf 100644 --- a/src/main/java/com/guaiguailang/harmony/service/impl/AuthServiceImpl.java +++ b/src/main/java/com/guaiguailang/harmony/service/impl/AuthServiceImpl.java @@ -53,6 +53,7 @@ public class AuthServiceImpl implements AuthService { // 根据账号查询用户 UserInfo userInfo = userMapper.getUserByAccount(loginParam.getUsername()); + if (userInfo == null) { return ResponseResult.error("用户不存在"); } diff --git a/src/main/resources/mapper/ActivateMapper.xml b/src/main/resources/mapper/ActivateMapper.xml index c63e369..b66d8dc 100644 --- a/src/main/resources/mapper/ActivateMapper.xml +++ b/src/main/resources/mapper/ActivateMapper.xml @@ -3,5 +3,51 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file