Controller统一返回对象需要精细化到method

master
3y 2 years ago
parent 712de46ec7
commit 68454a323f

@ -154,7 +154,7 @@ public class PushHandler extends BaseHandler implements Handler {
SendPushParam param = SendPushParam.builder()
.requestId(String.valueOf(IdUtil.getSnowflake().nextId()))
.pushMessage(SendPushParam.PushMessageVO.builder().notification(SendPushParam.PushMessageVO.NotificationVO.builder()
.title(pushContentModel.getTitle()).body(pushContentModel.getContent()).clickType("startapp").build())
.title(pushContentModel.getTitle()).body(pushContentModel.getContent()).clickType("startapp").build())
.build())
.build();
if (CollUtil.isNotEmpty(cid)) {

@ -51,7 +51,7 @@ public class ShieldServiceImpl implements ShieldService {
}
if (ShieldType.NIGHT_SHIELD_BUT_NEXT_DAY_SEND.getCode().equals(taskInfo.getShieldType())) {
redisUtils.lPush(NIGHT_SHIELD_BUT_NEXT_DAY_SEND_KEY, JSON.toJSONString(taskInfo,
SerializerFeature.WriteClassName),
SerializerFeature.WriteClassName),
(DateUtil.offsetDay(new Date(), 1).getTime() / 1000) - DateUtil.currentSeconds());
logUtils.print(AnchorInfo.builder().state(AnchorState.NIGHT_SHIELD_NEXT_SEND.getCode()).businessId(taskInfo.getBusinessId()).ids(taskInfo.getReceiver()).build());
}

@ -54,7 +54,7 @@ public class AustinAspect {
* @param joinPoint
*/
@Before("executeService()")
public void doBeforeAdvice(JoinPoint joinPoint){
public void doBeforeAdvice(JoinPoint joinPoint) {
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
this.printRequestLog(methodSignature, joinPoint.getArgs());
}
@ -97,7 +97,7 @@ public class AustinAspect {
logVo.setReferer(request.getHeader("referer"));
logVo.setRemoteAddr(request.getRemoteAddr());
logVo.setUserAgent(request.getHeader("user-agent"));
log.info("austin-aspect-log,request:" + JSON.toJSONString(logVo));
log.info("austin-aspect-log,request:{}", JSON.toJSONString(logVo));
}
/**
@ -108,6 +108,6 @@ public class AustinAspect {
public void printExceptionLog(Throwable ex) {
JSONObject logVo = new JSONObject();
logVo.put("id", request.getAttribute(requestIdKey));
log.error("austin-aspect-log,exception:" + JSON.toJSONString(logVo), ex);
log.error("austin-aspect-log,exception:{}", JSON.toJSONString(logVo), ex);
}
}

@ -32,7 +32,6 @@ import java.util.Objects;
*/
@Slf4j
@AustinAspect
@AustinResult
@RestController
@RequestMapping("/miniProgram")
@Api("微信服务号")
@ -43,6 +42,7 @@ public class MiniProgramController {
@GetMapping("/template/list")
@ApiOperation("/根据账号Id获取模板列表")
@AustinResult
public List<CommonAmisVo> queryList(Integer id) {
try {
List<CommonAmisVo> result = new ArrayList<>();
@ -67,6 +67,7 @@ public class MiniProgramController {
*/
@PostMapping("/detailTemplate")
@ApiOperation("/根据账号Id和模板ID获取模板列表")
@AustinResult
public CommonAmisVo queryDetailList(Integer id, String wxTemplateId) {
if (Objects.isNull(id) || Objects.isNull(wxTemplateId)) {
throw new CommonException(RespStatusEnum.CLIENT_BAD_PARAMETERS);

@ -46,7 +46,6 @@ import java.util.*;
*/
@Slf4j
@AustinAspect
@AustinResult
@RequestMapping("/officialAccount")
@RestController
@Api("微信服务号")
@ -68,6 +67,7 @@ public class OfficialAccountController {
*/
@GetMapping("/template/list")
@ApiOperation("/根据账号Id获取模板列表")
@AustinResult
public List<CommonAmisVo> queryList(Integer id) {
try {
List<CommonAmisVo> result = new ArrayList<>();
@ -93,6 +93,7 @@ public class OfficialAccountController {
*/
@PostMapping("/detailTemplate")
@ApiOperation("/根据账号Id和模板ID获取模板列表")
@AustinResult
public CommonAmisVo queryDetailList(Integer id, String wxTemplateId) {
if (Objects.isNull(id) || Objects.isNull(wxTemplateId)) {
throw new CommonException(RespStatusEnum.CLIENT_BAD_PARAMETERS);
@ -168,6 +169,7 @@ public class OfficialAccountController {
*/
@PostMapping("/qrCode")
@ApiOperation("/生成 服务号 二维码")
@AustinResult
public CommonAmisVo getQrCode() {
try {
WeChatLoginConfig configService = loginUtils.getLoginConfig();
@ -192,6 +194,7 @@ public class OfficialAccountController {
*/
@RequestMapping("/check/login")
@ApiOperation("/检查是否已经登录")
@AustinResult
public WxMpUser checkLogin(String sceneId) {
try {
String userInfo = redisTemplate.opsForValue().get(sceneId);
@ -216,6 +219,7 @@ public class OfficialAccountController {
*/
@RequestMapping("/delete/test/user")
@ApiOperation("/删除测试号的测试用户")
@AustinResult
public void deleteTestUser(HttpServletRequest request) {
try {

Loading…
Cancel
Save