package com.purui.prims.headless.server.service;


import com.github.pagehelper.PageInfo;
import com.purui.prims.auth.api.authentication.pojo.User;
import com.purui.prims.headless.api.pojo.AppAuthConfig;
import com.purui.prims.headless.api.pojo.enums.AppAuthType;
import com.purui.prims.headless.api.pojo.request.AppQueryReq;
import com.purui.prims.headless.api.pojo.request.AppReq;
import com.purui.prims.headless.api.pojo.response.AppDetailResp;
import com.purui.prims.headless.api.pojo.response.AppResp;

public interface AppService {

    AppDetailResp save(AppReq app, User user);

    AppDetailResp updateConfig(Integer id, AppAuthConfig config, User user);

    void online(Integer id, User user);

    void offline(Integer id, User user);

    void delete(Integer id, User user);

    PageInfo<AppResp> pageApp(AppQueryReq appQueryReq, User user);

    AppDetailResp getApp(Integer id, User user);

    AppDetailResp getApp(Integer id);

    AppDetailResp getApp(String appId);

    boolean checkPermission(Integer id, AppAuthType type, Long keyId);
}
