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

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.SysDictDataDO;

import java.util.Date;
import java.util.List;

/**
 * Generate Code By Unimall
 */
@HttpOpenApi(group = "admin.dict", description = "数据字典")
public interface DictService {

    @HttpMethod(description = "删除", permission = "dict:dict: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 = "dict:dict:get", permissionParentName = "数据字典", permissionName = "获取")
    public List<SysDictDataDO> getDictDataList(
            @NotNull @HttpParam(name = "dictType", type = HttpParamType.COMMON, description = "dictType") String dictType,
            @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 = "dict:dict:list", permissionParentName = "数据字典", permissionName = "查询")
    public Page<SysDictDataDO> list(
            @HttpParam(name = "dictName", type = HttpParamType.COMMON, description = "字典类型") String dictName,
            @HttpParam(name = "label", type = HttpParamType.COMMON, description = "字典名称") String label,
            @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 = "dict:dict:create", permissionParentName = "数据字典", permissionName = "添加")
    public SysDictDataDO create(
            @NotNull @HttpParam(name = "dictName", type = HttpParamType.COMMON, description = "字典类型") String dictName,
            @NotNull @HttpParam(name = "dictType", type = HttpParamType.COMMON, description = "字典编号") String dictType,
            @NotNull @HttpParam(name = "label", type = HttpParamType.COMMON, description = "字典名称") String label,
            @NotNull @HttpParam(name = "value", type = HttpParamType.COMMON, description = "字典数据") String value,
            @HttpParam(name = "sort", type = HttpParamType.COMMON, description = "排序") Integer sort,
            @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 = "dict:dict:edit", permissionParentName = "数据字典", permissionName = "编辑")
    public String edit(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "主键") Long id,
            @NotNull @HttpParam(name = "dictName", type = HttpParamType.COMMON, description = "字典类型") String dictName,
            @NotNull @HttpParam(name = "dictType", type = HttpParamType.COMMON, description = "字典编号") String dictType,
            @NotNull @HttpParam(name = "label", type = HttpParamType.COMMON, description = "字典名称") String label,
            @NotNull @HttpParam(name = "value", type = HttpParamType.COMMON, description = "字典数据") String value,
            @HttpParam(name = "sort", type = HttpParamType.COMMON, description = "排序") Integer sort,
            @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;

}
