package com.pj.tb_group;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.pj.api.dto.GroupDto;
import com.pj.api.dto.HtGroupDto;
import com.pj.current.satoken.StpAPPUserUtil;
import com.pj.project4sp.SP;
import com.pj.utils.sg.AjaxJson;
import com.pj.utils.so.SoMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;


/**
 * Controller: tb_group -- 互助组
 *
 * @author qzy
 */
@RestController
@RequestMapping("/app/TbGroup/")
public class TbGroupAPPController {

    /**
     * 底层 Service 对象
     */
    @Autowired
    TbGroupService tbGroupService;

    /**
     * 查集合 - 根据条件（参数为空时代表忽略指定条件）
     */
    @RequestMapping("getList")
    public AjaxJson getList() {
        if (!StpAPPUserUtil.isLogin()) {
            return AjaxJson.getError("未登录");
        }
        SoMap so = SoMap.getRequestSoMap();
        List<TbGroup> list = tbGroupService.getList(so.startPage());
        return AjaxJson.getPageData(so.getDataCount(), list);
    }



}
