All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.lightapi.portal.db.PortalDbProvider Maven / Gradle / Ivy

There is a newer version: 2.1.33
Show newest version
package net.lightapi.portal.db;

import com.networknt.db.provider.DbProvider;
import com.networknt.monad.Result;
import net.lightapi.portal.market.*;
import net.lightapi.portal.user.*;

import java.util.Map;

/**
 * Interface class provide the contract for different database implementation for the portal. Mainly, the data is
 * saved in the database. However, for some temp date like the oauth code, it is saved in the memory. The Kafka
 * event will be used to sync the data between the memory caches.
 *
 * @author Steve Hu
 */
public interface PortalDbProvider extends DbProvider {

    Result queryUserByEmail(String email);
    Result queryUserById(String id);
    Result queryUserByWallet(String wallet);
    Result queryEmailByWallet(String wallet);
    Result createUser(UserCreatedEvent event);
    Result confirmUser(UserConfirmedEvent event);
    Result queryNonceByEmail(String email);
    Result createSocialUser(SocialUserCreatedEvent event);
    Result updateUser(UserUpdatedEvent event);
    Result deleteUser(UserDeletedEvent event);
    Result updateUserRoles(UserRolesUpdatedEvent event);
    Result forgetPassword(PasswordForgotEvent event);
    Result resetPassword(PasswordResetEvent event);
    Result changePassword(PasswordChangedEvent event);
    Result updatePayment(PaymentUpdatedEvent event);
    Result deletePayment(PaymentDeletedEvent event);
    Result createOrder(OrderCreatedEvent event);
    Result cancelOrder(OrderCancelledEvent event);
    Result deliverOrder(OrderDeliveredEvent event);
    Result sendPrivateMessage(PrivateMessageSentEvent event);

    Result createClient(MarketClientCreatedEvent event);
    Result updateClient(MarketClientUpdatedEvent event);
    Result deleteClient(MarketClientDeletedEvent event);
    Result> queryClientByClientId(String clientId);
    Result> queryClientByHostAppId(String host, String applicationId);

    Result createService(MarketServiceCreatedEvent event);
    Result updateService(MarketServiceUpdatedEvent event);
    Result deleteService(MarketServiceDeletedEvent event);

    Result createMarketCode(MarketCodeCreatedEvent event);
    Result deleteMarketCode(MarketCodeDeletedEvent event);
    Result queryMarketCode(String authCode);

    Result createHost(HostCreatedEvent event);
    Result updateHost(HostUpdatedEvent event);
    Result deleteHost(HostDeletedEvent event);
    Result> queryHostByHost(String host);
    Result> queryHostById(String id);
    Result> queryHostByOwner(String owner);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy