标签组新增标签组名不可重复
This commit is contained in:
@@ -25,7 +25,7 @@ public interface LabelGroupService {
|
||||
* 添加标签组
|
||||
* @param dto 新增标签组信息
|
||||
*/
|
||||
void addLabelGroup(LabelGroupAddDTO dto);
|
||||
void addLabelGroup(LabelGroupAddDTO dto) throws ApiException;
|
||||
|
||||
/**
|
||||
* 修改标签组信息
|
||||
|
||||
@@ -47,10 +47,14 @@ public class LabelGroupServiceImpl implements LabelGroupService {
|
||||
* @param dto 新增标签组信息
|
||||
*/
|
||||
@Override
|
||||
public void addLabelGroup(LabelGroupAddDTO dto) {
|
||||
public void addLabelGroup(LabelGroupAddDTO dto) throws ApiException {
|
||||
HyPartnerLabelGroupDO labelGroupDO = new HyPartnerLabelGroupDO();
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
labelGroupDO.setLabelGroupName(dto.getLabelGroupName());
|
||||
List<HyPartnerLabelGroupDO> existLabelGroup = labelGroupMapper.selectSelective(labelGroupDO);
|
||||
if (existLabelGroup != null && existLabelGroup.size() > 0) {
|
||||
throw new ApiException(ErrorCodeEnum.LABEL_GROUP_EXIST);
|
||||
}
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
labelGroupDO.setEditUserId(userId);
|
||||
labelGroupDO.setEditDate(new Date());
|
||||
labelGroupDO.setCreateUserId(userId);
|
||||
|
||||
Reference in New Issue
Block a user