feat: 活动编辑功能完成
This commit is contained in:
parent
2dbafa77ea
commit
97b6f2ddb3
@ -24,8 +24,6 @@ public class ActivateController {
|
|||||||
// todo 以后可考虑按机构来加载
|
// todo 以后可考虑按机构来加载
|
||||||
return ResponseEntity.ok(activateService.loadActivate());
|
return ResponseEntity.ok(activateService.loadActivate());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "活动 新增",
|
summary = "活动 新增",
|
||||||
description = "新增一个活动",
|
description = "新增一个活动",
|
||||||
@ -35,5 +33,14 @@ public class ActivateController {
|
|||||||
public ResponseEntity addActivate(@RequestBody ActiveBaseInfo activeBaseInfo){
|
public ResponseEntity addActivate(@RequestBody ActiveBaseInfo activeBaseInfo){
|
||||||
return ResponseEntity.ok(activateService.addActivate(activeBaseInfo));
|
return ResponseEntity.ok(activateService.addActivate(activeBaseInfo));
|
||||||
}
|
}
|
||||||
|
@Operation(
|
||||||
|
summary = "活动 更新",
|
||||||
|
description = "更新活动基本信息",
|
||||||
|
tags = {"活动相关接口"}
|
||||||
|
)
|
||||||
|
@PostMapping("/update")
|
||||||
|
public ResponseEntity updateActivate(@RequestBody ActiveBaseInfo activeBaseInfo){
|
||||||
|
return ResponseEntity.ok(activateService.updateActivate(activeBaseInfo));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,13 +13,14 @@ import io.swagger.v3.oas.annotations.media.Content;
|
|||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@Tag(name="系统认证接口")
|
@Tag(name="系统认证接口")
|
||||||
@RequestMapping("/auth")
|
@RequestMapping("/auth")
|
||||||
@ -87,7 +88,9 @@ public class AuthController {
|
|||||||
)
|
)
|
||||||
@PostMapping("/logout")
|
@PostMapping("/logout")
|
||||||
public ResponseEntity logout() {
|
public ResponseEntity logout() {
|
||||||
|
String id = StpUtil.getLoginId().toString();
|
||||||
StpUtil.logout();
|
StpUtil.logout();
|
||||||
|
log.info("用户"+id+"退出");
|
||||||
return ResponseEntity.ok().build();
|
return ResponseEntity.ok().build();
|
||||||
}
|
}
|
||||||
@Operation(
|
@Operation(
|
||||||
|
@ -12,4 +12,6 @@ public interface ActivateService {
|
|||||||
ResponseResult addActivate(ActiveBaseInfo activeBaseInfo);
|
ResponseResult addActivate(ActiveBaseInfo activeBaseInfo);
|
||||||
|
|
||||||
ResponseResult loadActivate();
|
ResponseResult loadActivate();
|
||||||
|
|
||||||
|
ResponseResult updateActivate(ActiveBaseInfo activeBaseInfo);
|
||||||
}
|
}
|
||||||
|
@ -70,4 +70,14 @@ public class ActivateServiceImpl implements ActivateService {
|
|||||||
List<ActiveBaseInfo> activeList = activateMapper.selectList(queryWrapper);
|
List<ActiveBaseInfo> activeList = activateMapper.selectList(queryWrapper);
|
||||||
return ResponseResult.success(activeList);
|
return ResponseResult.success(activeList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseResult updateActivate(ActiveBaseInfo activeBaseInfo) {
|
||||||
|
int i = activateMapper.updateById(activeBaseInfo);
|
||||||
|
if(i>0){
|
||||||
|
return ResponseResult.success(activeBaseInfo);
|
||||||
|
}else{
|
||||||
|
return ResponseResult.error("更新失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user