<%#
 Copyright 2013-2021 the original author or authors from the BegCode project.

 This file is part of the JHipster project, see https://www.jhipster.tech/
 for more information.

 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

      https://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.
-%>
<%_
const viaService = !serviceNo;
const beans = [];
_%>
package <%= entityAbsolutePackage %>.web.rest;

import <%= entityAbsolutePackage %>.repository.<%= entityClass %>Repository;
<%_ if (!serviceNo) { _%>
import <%= entityAbsolutePackage %>.service.<%= entityClass %>Service;
<%_ } else { _%>
  <%_ if (isUsingMapsId) { _%>
import <%= entityAbsolutePackage %>.repository.<%= mapsIdAssoc.otherEntityNameCapitalized %>Repository;
  <%_ } _%>
  <%_ if (searchEngineElasticsearch) { _%>
import <%= entityAbsolutePackage %>.repository.search.<%= entityClass %>SearchRepository;
  <%_ } _%>
<%_ } _%>
import <%= entityAbsolutePackage %>.web.rest.base.<%= persistClass %>BaseResource;
<%_ if (jpaMetamodelFiltering) {  _%>
import <%= entityAbsolutePackage %>.service.<%= entityClass %>QueryService;
<%_ } _%>
import org.springframework.web.bind.annotation.*;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<%_ if (addCustomMethod.indexOf('rest') !== -1) { _%>
<%- include(`../../../_entityCustom_/${entityClass}.rest.ejs`, {position: 'extendsImport'}); -%>
<%_ } _%>

// jhipster-needle-add-import - JHipster will add getters and setters here, do not remove

/**
<% if ((enableTranslation && nativeLanguage === 'zh-cn') || !enableTranslation ) { %>
 * 管理实体{@link <%= entityAbsoluteClass %>}的REST Controller。
<%_ } else { _%>
 * REST controller for managing {@link <%= entityAbsoluteClass %>}.
<%_ } _%>
 */
@RestController
@RequestMapping("/api/<%= entityApiUrl %>")
@Tag(name = "<%= entityApiUrl %>", description = "<%= bcTitle %>API接口")
<%_ if (databaseTypeSql && !viaService && !saveUserSnapshot) { _%>
@Transactional
<%_ } _%>
public class <%= entityClass %>Resource extends <%= entityClass %>BaseResource {

    private final Logger log = LoggerFactory.getLogger(<%= entityClass %>Resource.class);
    <%_
    const instanceType = restClass;
    const instanceName = restInstance;
    const mapper = entityInstance  + 'Mapper';
    const entityToDtoReference = mapper + '::' + 'toDto';
    _%><% if (addCustomMethod.indexOf('rest') !== -1) { %><%- include(`../../../_entityCustom_/${entityClass}.construct.ejs`, {viaService: viaService,isController: true, beans: beans});-%><% } %><%- include('../../_partials_entity_/blank_inject_template', {viaService: viaService, constructorName: entityClass + 'Resource', queryService: jpaMetamodelFiltering, isUsingMapsId: isUsingMapsId, mapsIdAssoc: mapsIdAssoc, isController: true, beans: beans}); -%>

    // begcode-please-regenerate-this-file 如果您不希望重新生成代码时被覆盖，将please修改为don't ！！！
}
