This commit is contained in:
parent
1037acfb14
commit
a00f87418d
|
|
@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author clay
|
* @author clay
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@ public class Result<T> {
|
||||||
|
|
||||||
private T data;// 成功时返回的数据
|
private T data;// 成功时返回的数据
|
||||||
|
|
||||||
private String errorMsg;// 错误信息
|
private String msg;// 错误信息
|
||||||
|
|
||||||
private int errorCode;
|
private int code;
|
||||||
|
|
||||||
public Result() {
|
public Result() {
|
||||||
}
|
}
|
||||||
|
|
@ -29,10 +29,10 @@ public class Result<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 错误时的构造器
|
// 错误时的构造器
|
||||||
public Result(boolean success, int errorCode, String errorMsg) {
|
public Result(boolean success, int code, String msg) {
|
||||||
this.success = success;
|
this.success = success;
|
||||||
this.errorMsg = errorMsg;
|
this.msg = msg;
|
||||||
this.errorCode = errorCode;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSuccess() {
|
public boolean isSuccess() {
|
||||||
|
|
@ -51,20 +51,19 @@ public class Result<T> {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getErrorMsg() {
|
public String getMsg() {
|
||||||
return errorMsg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setErrorMsg(String errorMsg) {
|
public void setMsg(String msg) {
|
||||||
this.errorMsg = errorMsg;
|
this.msg = msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getErrorCode() {
|
public int getCode() {
|
||||||
return errorCode;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setErrorCode(int errorCode) {
|
public void setCode(int code) {
|
||||||
this.errorCode = errorCode;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author clay
|
* @author clay
|
||||||
|
|
@ -40,6 +41,7 @@ public class MailConfigServiceImpl implements MailConfigService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public ServerResult editMailConfig(MailConfig mailConfig) {
|
public ServerResult editMailConfig(MailConfig mailConfig) {
|
||||||
try {
|
try {
|
||||||
Integer statr = mailConfigDao.updateMailConfig(mailConfig);
|
Integer statr = mailConfigDao.updateMailConfig(mailConfig);
|
||||||
|
|
|
||||||
|
|
@ -6,16 +6,16 @@
|
||||||
<select id="getMailConfig" resultType="live.tomey.api.express.entity.MailConfig">
|
<select id="getMailConfig" resultType="live.tomey.api.express.entity.MailConfig">
|
||||||
SELECT * FROM w_mailconfig WHERE id = 1
|
SELECT * FROM w_mailconfig WHERE id = 1
|
||||||
</select>
|
</select>
|
||||||
<select id="updateMailConfig" resultType="updateMailConfig">
|
<update id="updateMailConfig" parameterType="live.tomey.api.express.entity.MailConfig">
|
||||||
UPDATE w_mailconfig SET
|
UPDATE w_mailconfig SET
|
||||||
w_mailconfig.sender = #{mailConfig.sender},
|
w_mailconfig.sender = #{mailConfig.sender},
|
||||||
w_mailconfig.personal = #{mailConfig.personal},
|
w_mailconfig.personal = #{mailConfig.personal},
|
||||||
w_mailconfig.email_smtp_host = #{mailConfig.emailSmtpHost},
|
w_mailconfig.email_smtp_host = #{mailConfig.emailSmtpHost},
|
||||||
w_mailconfig.email_smtp_port = #{mailConfig.emailSmtpPort},
|
w_mailconfig.email_smtp_port = #{mailConfig.emailSmtpPort},
|
||||||
w_mailconfig.username = #{mailConfig.username},
|
w_mailconfig.username = #{mailConfig.username},
|
||||||
w_mailconfig.password = #{mailConfig.password},
|
w_mailconfig.password = #{mailConfig.password},
|
||||||
w_mailconfig.encryption = #{mailConfig.encryption},
|
w_mailconfig.encryption = #{mailConfig.encryption},
|
||||||
w_mailconfig.state = #{mailConfig.sender}
|
w_mailconfig.state = #{mailConfig.state}
|
||||||
WHERE w_mailconfig.id = 1
|
WHERE w_mailconfig.id = 1
|
||||||
</select>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue