{{#eq apps "link"}}
package {{packageName}}.api.{{apps}}.dict;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import cn.ibizlab.edge.api.link.annotation.G1;
import java.util.*;

@Slf4j
@Api(tags = {"数据字典" })
@RestController("link-DictAllJsonResource")
@RequestMapping("/link/dict")
@G1
@ApiSupport(order = 98)
public class DictAllJsonResource {


    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "全部字典", tags = {"数据字典" },  notes = "<a href=\"/xftong/link/dict/all.html\" target=\"_blank\">查看展示清单</a>&nbsp;&nbsp;<a href=\"/xftong/link/dict/all\" target=\"_blank\">查看json</a>")
    @RequestMapping(method = RequestMethod.GET, value = "/all")
    public ResponseEntity<Map<String,Object>> getDict() {
        Map<String,Object> all=new LinkedHashMap<>();
    {{#each app.dicts}}
        {
            Map<String,Object> dict=new LinkedHashMap<>();
            dict.put("code","{{pascalCase codeName}}Dict");
            dict.put("name","字典：{{name}}[{{pascalCase codeName}}Dict]");
            dict.put("allItems",new {{pascalCase codeName}}Dict().getAllItems());
            all.put("{{pascalCase codeName}}Dict",dict);
        }
    {{/each}}
        return ResponseEntity.ok(all);
    }

}
{{/eq}}