|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public class ReturnCommand { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private static Logger log = LogManager.getLogger(ReturnCommand.class) ; | 
|---|
|  |  |  | private static Logger log = LogManager.getLogger(ReturnCommand.class); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 处理命令成功 | 
|---|
|  |  |  | * @param message | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static Command successed(String message, String commandId, String code, Object attachment){ | 
|---|
|  |  |  | log.info(message) ; | 
|---|
|  |  |  | Command command = new Command().createReturnSuccessCommand(message, commandId, code) ; | 
|---|
|  |  |  | command.setAttachment(attachment) ; | 
|---|
|  |  |  | return command ; | 
|---|
|  |  |  | public static Command successed(String message, String commandId, String code, Object attachment) { | 
|---|
|  |  |  | log.info(message); | 
|---|
|  |  |  | Command command = new Command().createReturnSuccessCommand(message, commandId, code); | 
|---|
|  |  |  | command.setAttachment(attachment); | 
|---|
|  |  |  | return command; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 处理命令成功 | 
|---|
|  |  |  | * @param message | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static Command successed(String message, String commandId, String code){ | 
|---|
|  |  |  | log.info(message) ; | 
|---|
|  |  |  | return new Command().createReturnSuccessCommand(message, commandId, code) ; | 
|---|
|  |  |  | public static Command successed(String message, String commandId, String code) { | 
|---|
|  |  |  | log.info(message); | 
|---|
|  |  |  | return new Command().createReturnSuccessCommand(message, commandId, code); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 处理命令发生错误 | 
|---|
|  |  |  | * @param message | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static Command errored(String message, String commandId, String code){ | 
|---|
|  |  |  | log.error(message) ; | 
|---|
|  |  |  | return new Command().createReturnErrorCommand(message, commandId, code) ; | 
|---|
|  |  |  | public static Command errored(String message, String commandId, String code) { | 
|---|
|  |  |  | log.error(message); | 
|---|
|  |  |  | return new Command().createReturnErrorCommand(message, commandId, code); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|