-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
122 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/main/java/com/sirius/spurt/service/business/user/CheckUserHasPinedBusiness.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.sirius.spurt.service.business.user; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.sirius.spurt.common.template.Business; | ||
import com.sirius.spurt.service.business.user.CheckUserHasPinedBusiness.Dto; | ||
import com.sirius.spurt.service.business.user.CheckUserHasPinedBusiness.Result; | ||
import com.sirius.spurt.store.provider.user.UserProvider; | ||
import java.io.Serializable; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.validation.annotation.Validated; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class CheckUserHasPinedBusiness implements Business<Dto, Result> { | ||
private final UserProvider userProvider; | ||
|
||
@Override | ||
public Result execute(Dto input) { | ||
return Result.builder().hasPined(userProvider.checkHasPined(input.getUserId())).build(); | ||
} | ||
|
||
@JsonIgnoreProperties | ||
@Data | ||
@Validated | ||
@Builder | ||
public static class Dto implements Business.Dto, Serializable { | ||
private String userId; | ||
} | ||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Data | ||
@JsonIgnoreProperties | ||
@Builder | ||
public static class Result implements Business.Result, Serializable { | ||
private boolean hasPined; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters