com.nb6868.onex.msg.service.MailTplService Maven / Gradle / Ivy
package com.nb6868.onex.msg.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.nb6868.onex.common.exception.ErrorCode;
import com.nb6868.onex.common.jpa.DtoService;
import com.nb6868.onex.common.util.WrapperUtils;
import com.nb6868.onex.common.validator.AssertUtils;
import com.nb6868.onex.msg.dao.MailTplDao;
import com.nb6868.onex.msg.dto.MailTplDTO;
import com.nb6868.onex.msg.entity.MailTplEntity;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* 邮件模板
*
* @author Charles [email protected]
*/
@Service
public class MailTplService extends DtoService {
@Override
public QueryWrapper getWrapper(String method, Map params) {
return new WrapperUtils(new QueryWrapper<>(), params)
.eq("type", "type")
.eq("code", "code")
.like("name", "name")
.getQueryWrapper();
}
@Override
protected void beforeSaveOrUpdateDto(MailTplDTO dto, int type) {
AssertUtils.isTrue(hasDuplicated(dto.getId(), "code", dto.getCode()), ErrorCode.ERROR_REQUEST, "编码已存在");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy