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;

import java.util.List;

public interface AppService {

    AppDetailResp save(AppReq app, User user);

    AppDetailResp updateConfig(Long id, List<AppAuthConfig> config, User user);

    void online(Long id, User user);

    void offline(Long id, User user);

    void delete(Long id, User user);

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

    AppDetailResp getApp(Long id, User user);

    AppDetailResp getApp(Long id);

    AppDetailResp getApp(String appId);

    boolean checkPermission(AppResp app, AppAuthType type, Long keyId);
}
