IndexController.java 1.75 KB
Newer Older
liqin's avatar
liqin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
package cn.wisenergy.chnmuseum.party.web.controller;

import cn.wisenergy.chnmuseum.party.model.Index;
import cn.wisenergy.chnmuseum.party.service.IndexService;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 首页使用
 * </p>
 *
 * @author 杨建龙
 * @since 2018-10-08
 */
@Api(tags = "首页使用")
@RestController
@RequestMapping("/index")
public class IndexController extends BaseController {

    private static final Logger logger = LoggerFactory.getLogger(IndexController.class);

    @Resource
    private IndexService indexService;

    /**
     * 获取首页列表数据
     *
     * @return
     */
    @ApiOperation(value = "获取首页列表数据")
    @GetMapping(value = "/getIndexList")
    @RequiresPermissions("/index/getIndexList")
    public ResponseEntity<List<Index>> getIndexList(String roleId, String bankBranchId, String userId) {
        try {
            List<Index> indexList = this.indexService.getIndexList(roleId, bankBranchId);
            return ResponseEntity.ok(indexList);
        } catch (Exception e) {
            logger.error("获取首页列表数据出错!", e);
        }
        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
    }

}