package com.kmall.api.api;

import com.kmall.api.annotation.IgnoreAuth;
import com.kmall.api.entity.HelpIssueVo;
import com.kmall.api.entity.HelpTypeVo;
import com.kmall.api.service.ApiHelpIssueService;
import com.kmall.api.service.ApiHelpTypeService;
import com.kmall.api.util.ApiBaseAction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Controller
 *
 * @author Scott
 * @email
 * @date 2017-12-02 10:04:20
 */
@RestController
@RequestMapping("api/helpissue")
public class ApiHelpIssueController extends ApiBaseAction {
    @Autowired
    private ApiHelpIssueService helpIssueService;
    @Autowired
    private ApiHelpTypeService helpTypeService;

    /**
     * 查看帮助类型列表
     */
    @GetMapping("/typeList")
    @IgnoreAuth
    public Object typeList() {

        List<HelpTypeVo> list = helpTypeService.queryList(new HashMap());

        return toResponsSuccess(list);
    }

    /**
     * 查看问题列表
     */
    @GetMapping("/issueList")
    @IgnoreAuth
    public Object issueList(Long type_id,String merchSn) {

        Map params = new HashMap();
        params.put("type_id", type_id);
        params.put("merchSn",merchSn);
        List<HelpIssueVo> helpIssueList = helpIssueService.queryList(params);

        return toResponsSuccess(helpIssueList);
    }
}
