{{#eq apps "link"}}
{{#if appEntity.forms}}
package {{packageName}}.api.{{apps}}.rest;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import {{packageName}}.api.{{apps}}.dto.{{pascalCase appEntities}}.*;
import {{packageName}}.api.{{apps}}.dict.*;

@Slf4j
@Api(tags = {"{{appEntity.entity.logicName}}" })
@RestController("{{lowerCase appEntity.app.codeName}}-{{lowerCase appEntity.entity.codeName}}")
@RequestMapping("/{{lowerCase appEntity.app.codeName}}/{{pluralize appEntity.entity.codeName}}")
public class {{pascalCase appEntity.codeName}}Resource {


    {{#each appEntity.forms}}
    @ApiOperation(value = "新建[{{codeName}}]{{replace logicName "表单" ""}}", tags = {"{{appEntity.entity.logicName}}" },  notes = "新建[{{codeName}}]{{replace logicName "表单" ""}}")
    @RequestMapping(method = RequestMethod.POST, value = "/{{lowerCase codeName}}")
    public ResponseEntity<{{pascalCase codeName}}Dto> add{{pascalCase appEntity.codeName}}{{pascalCase codeName}}(@Validated @RequestBody {{pascalCase codeName}}AddDto dto) {
        return null;
    }

    @ApiOperation(value = "更新[{{codeName}}]{{replace logicName "表单" ""}}", tags = {"{{appEntity.entity.logicName}}" },  notes = "更新[{{codeName}}]{{replace logicName "表单" ""}}")
    @RequestMapping(method = RequestMethod.PUT, value = "/{{lowerCase codeName}}/{id}")
    public ResponseEntity<{{pascalCase codeName}}Dto> update{{pascalCase appEntity.codeName}}{{pascalCase codeName}}(@ApiParam("{{appEntity.entity.keyField.logicName}}") @PathVariable("id") {{appEntity.entity.keyField.type.java}} {{camelCase appEntity.entity.keyField.codeName}},@Validated @RequestBody {{pascalCase codeName}}UpdateDto dto) {
        return null;
    }
    {{/each}}


}
{{/if}}
{{/eq}}