/*
 * Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ${package.Service};

import cn.orionsec.kit.lang.define.wrapper.DataGrid;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
#foreach($pkg in ${customModuleFilePackages})
import ${pkg}.*;
#end
import ${package.Entity}.${entity};

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * $!{table.comment} 服务类
 *
 * @author ${author}
 * @version ${version}
 * @since ${date}
 */
public interface ${table.serviceName} {

    /**
     * ${apiComment.create}
     *
     * @param request request
     * @return id
     */
    Long create${type}(${type}CreateRequest request);

    /**
     * ${apiComment.updateById}
     *
     * @param request request
     * @return effect
     */
    Integer update${type}ById(${type}UpdateRequest request);

    /**
     * ${apiComment.updateAll}
     *
     * @param query  query
     * @param update update
     * @return effect
     */
    Integer update${type}(${type}QueryRequest query, ${type}UpdateRequest update);

    /**
     * ${apiComment.getById}
     *
     * @param id id
     * @return row
     */
    ${type}VO get${type}ById(Long id);

    /**
     * ${apiComment.getByIdList}
     *
     * @param idList idList
     * @return rows
     */
    List<${type}VO> get${type}ByIdList(List<Long> idList);

    /**
     * ${apiComment.queryList}
     *
     * @param request request
     * @return rows
     */
    List<${type}VO> get${type}List(${type}QueryRequest request);

    #if($meta.enableCache)
    /**
     * ${apiComment.queryListByCache}
     *
     * @return rows
     */
    List<${type}VO> get${type}ListByCache();

    #end
    /**
     * ${apiComment.queryCount}
     *
     * @param request request
     * @return count
     */
    Long get${type}Count(${type}QueryRequest request);

    /**
     * ${apiComment.queryPage}
     *
     * @param request request
     * @return rows
     */
    DataGrid<${type}VO> get${type}Page(${type}QueryRequest request);

    /**
     * ${apiComment.deleteById}
     *
     * @param id id
     * @return effect
     */
    Integer delete${type}ById(Long id);

    /**
     * ${apiComment.batchDelete}
     *
     * @param idList idList
     * @return effect
     */
    Integer delete${type}ByIdList(List<Long> idList);

    /**
     * ${apiComment.deleteAll}
     *
     * @param request request
     * @return effect
     */
    Integer delete${type}(${type}QueryRequest request);

    /**
     * 构建查询 wrapper
     *
     * @param request request
     * @return wrapper
     */
    LambdaQueryWrapper<${type}DO> buildQueryWrapper(${type}QueryRequest request);

}
