package com.iotechn.unimall.admin.api.message;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.model.Page;
import com.iotechn.unimall.data.domain.MessageDO;

import java.util.Date;

/**
 * Generate Code By Unimall
 */
@HttpOpenApi(group = "admin.message", description = "消息管理")
public interface MessageService {

    @HttpMethod(description = "删除", permission = "message:message:delete", permissionParentName = "系统管理", permissionName = "消息管理")
    public boolean delete(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;


    @HttpMethod(description = "查询", permission = "message:message:list", permissionParentName = "系统管理", permissionName = "消息管理")
    public Page<MessageDO> list(
            @HttpParam(name = "customer", type = HttpParamType.COMMON, description = "客户") String customer,
            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "companyId", type = HttpParamType.COMPANY_ID, description = "管理员ID") Long companyId) throws ServiceException;

    @HttpMethod(description = "添加", permission = "message:message:create", permissionParentName = "系统管理", permissionName = "消息管理")
    public MessageDO create(
            @NotNull @HttpParam(name = "customer", type = HttpParamType.COMMON, description = "客户") String customer,
            @NotNull @HttpParam(name = "operation", type = HttpParamType.COMMON, description = "操作") String operation,
            @NotNull @HttpParam(name = "result", type = HttpParamType.COMMON, description = "结果") String result,
//            @NotNull @HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "创建时间") Date gmtCreate,
//            @NotNull @HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "更新时间") Date gmtUpdate,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "companyId", type = HttpParamType.COMPANY_ID, description = "管理员ID") Long companyId) throws ServiceException;

    @HttpMethod(description = "编辑", permission = "message:message:edit", permissionParentName = "系统管理", permissionName = "消息管理")
    public String edit(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "主键") Long id,
            @NotNull @HttpParam(name = "customer", type = HttpParamType.COMMON, description = "客户") String customer,
            @NotNull @HttpParam(name = "operation", type = HttpParamType.COMMON, description = "操作") String operation,
            @NotNull @HttpParam(name = "result", type = HttpParamType.COMMON, description = "结果") String result,
//            @NotNull @HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "创建时间") Date gmtCreate,
//            @NotNull @HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "更新时间") Date gmtUpdate,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "companyId", type = HttpParamType.COMPANY_ID, description = "管理员ID") Long companyId) throws ServiceException;

}
