作者 朱兆平

消息类型增加接口

... ... @@ -57,4 +57,11 @@ public class MessageTypesController {
boolean result = messageTypeService.del(messageType.getId());
return result ? new ResultJson("200","success") : new ResultJson("400","error");
}
@ApiOperation(value = "批量删除消息类", notes = "参数为id数组[1,2,3]")
@DeleteMapping("batchDelete")
public ResultJson delete(@RequestBody String[] ids){
boolean result = messageTypeService.batchDel(ids);
return result ? new ResultJson("200","success") : new ResultJson("400","error");
}
}
... ...
... ... @@ -7,6 +7,8 @@ import java.util.List;
public interface MessageTypeMapper {
int deleteByPrimaryKey(String id);
int batchDeleteByPrimaryKey(String[] array);
int insert(MessageType record);
int insertSelective(MessageType record);
... ...
... ... @@ -18,4 +18,6 @@ public interface MessageTypeService {
boolean del(String id);
boolean batchDel(String[] ids);
}
... ...
... ... @@ -52,4 +52,10 @@ public class MessageTypeServiceImp implements MessageTypeService {
return i > 0;
}
@Override
public boolean batchDel(String[] ids) {
int i = messageTypeMapper.batchDeleteByPrimaryKey(ids);
return i > 0;
}
}
... ...
... ... @@ -54,6 +54,15 @@
delete from message_type
where ID = #{id,jdbcType=VARCHAR}
</delete>
<delete id="batchDeleteByPrimaryKey" parameterType="java.lang.String" >
delete from message_type
where ID in
<foreach collection="array" item="outputId" open="(" separator="," close=")">
#{outputId}
</foreach>
</delete>
<insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageType" >
insert into message_type (ID, name, parent_id,
des, type)
... ...