@ -6,6 +6,7 @@ import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.exception.EpmetErrorCode ;
import com.epmet.commons.tools.exception.RenException ;
import com.epmet.commons.tools.utils.ConvertUtils ;
import com.epmet.commons.tools.utils.Result ;
import com.epmet.service.UserPointActionLogService ;
import dto.form.SendPointFormDTO ;
import lombok.extern.slf4j.Slf4j ;
@ -41,11 +42,11 @@ public class MqPointCallbackController {
* @return
* /
@RequestMapping ( "activeSendPoint" )
public String activeSendPoint ( @RequestBody ReceiveMqMsg mqMsg ) {
public Result < Boolean > activeSendPoint ( @RequestBody ReceiveMqMsg mqMsg ) {
log . debug ( "activeSendPoint receive mqMsg:{}" , JSON . toJSONString ( mqMsg ) ) ;
if ( mqMsg = = null | | StringUtils . isBlank ( mqMsg . getMsg ( ) ) ) {
log . warn ( "activeSendPoint mqMsg is empty" ) ;
return "success" ;
return new Result < Boolean > ( ) . ok ( true ) ;
}
List < SendPointFormDTO > formDTO = JSON . parseArray ( mqMsg . getMsg ( ) , SendPointFormDTO . class ) ;
try {
@ -55,7 +56,7 @@ public class MqPointCallbackController {
throw new RenException ( EpmetErrorCode . SERVER_ERROR . getMsg ( ) ) ;
}
log . info ( "activeSendPoint consumer success,formDTO:{}" , JSON . toJSONString ( formDTO ) ) ;
return "success" ;
return new Result < Boolean > ( ) . ok ( true ) ;
}
/ * *
@ -65,11 +66,11 @@ public class MqPointCallbackController {
* @return
* /
@RequestMapping ( "registervolunteer" )
public String registerVolunteer ( @RequestBody ReceiveMqMsg mqMsg ) {
public Result < Boolean > registerVolunteer ( @RequestBody ReceiveMqMsg mqMsg ) {
log . debug ( "registerVolunteer receive mqMsg:{}" , JSON . toJSONString ( mqMsg ) ) ;
if ( mqMsg = = null | | StringUtils . isBlank ( mqMsg . getMsg ( ) ) ) {
log . warn ( "registerVolunteer mqMsg is empty" ) ;
return "success" ;
return new Result < Boolean > ( ) . ok ( true ) ;
}
BasePointEventMsg formDTO = ConvertUtils . sourceToTarget ( mqMsg . getMsg ( ) , BasePointEventMsg . class ) ;
try {
@ -79,7 +80,7 @@ public class MqPointCallbackController {
throw new RenException ( EpmetErrorCode . SERVER_ERROR . getMsg ( ) ) ;
}
log . info ( "registerVolunteer consumer success,formDTO:{}" , JSON . toJSONString ( formDTO ) ) ;
return "success" ;
return new Result < Boolean > ( ) . ok ( true ) ;
}
/ * *
@ -89,11 +90,11 @@ public class MqPointCallbackController {
* @return
* /
@RequestMapping ( "pubactivelive" )
public String pubActiveLive ( @RequestBody ReceiveMqMsg mqMsg ) {
public Result < Boolean > pubActiveLive ( @RequestBody ReceiveMqMsg mqMsg ) {
log . debug ( "pubActiveLive receive mqMsg:{}" , JSON . toJSONString ( mqMsg ) ) ;
if ( mqMsg = = null | | StringUtils . isBlank ( mqMsg . getMsg ( ) ) ) {
log . warn ( "pubActiveLive mqMsg is empty" ) ;
return "success" ;
return new Result < Boolean > ( ) . ok ( true ) ;
}
BasePointEventMsg formDTO = ConvertUtils . sourceToTarget ( mqMsg . getMsg ( ) , BasePointEventMsg . class ) ;
try {
@ -103,7 +104,7 @@ public class MqPointCallbackController {
throw new RenException ( EpmetErrorCode . SERVER_ERROR . getMsg ( ) ) ;
}
log . info ( "pubActiveLive consumer success,formDTO:{}" , JSON . toJSONString ( formDTO ) ) ;
return "success" ;
return new Result < Boolean > ( ) . ok ( true ) ;
}
}