Skip to content

Commit

Permalink
release: 0.6.7 (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
devxb authored Jul 7, 2024
2 parents 1ab9df5 + f5f44cb commit 413d03a
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ kotestExtensionSpringVersion=1.1.3
testContainerVersion=1.19.3

### Netx ###
netxVersion=0.4.4-beta-1
netxVersion=0.4.5

### Sentry ###
sentryVersion=4.4.0
Expand Down
3 changes: 3 additions & 0 deletions src/main/kotlin/org/gitanimals/render/app/AnimationFacade.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.gitanimals.render.app
import org.gitanimals.render.domain.Mode
import org.gitanimals.render.domain.User
import org.gitanimals.render.domain.UserService
import org.gitanimals.render.domain.event.NewUserCreated
import org.gitanimals.render.domain.event.Visited
import org.rooftop.netx.api.SagaManager
import org.springframework.stereotype.Service
Expand All @@ -25,6 +26,7 @@ class AnimationFacade(

false -> {
val user = createNewUser(username)
sagaManager.startSync(NewUserCreated(user.id, user.name))
userService.getFarmAnimationByUsername(user.name)
}
}
Expand All @@ -40,6 +42,7 @@ class AnimationFacade(

false -> {
val user = createNewUser(username)
sagaManager.startSync(NewUserCreated(user.id, user.name))
userService.getLineAnimationByUsername(user.name, personaId, mode)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package org.gitanimals.render.controller

import org.gitanimals.render.app.AuthorizationException
import org.gitanimals.render.app.UserFacade
import org.gitanimals.render.controller.request.AddMultiplyPersonaRequest
import org.gitanimals.render.controller.request.AddPersonaRequest
import org.gitanimals.render.controller.response.ErrorResponse
import org.gitanimals.render.controller.response.PersonaEnumResponse
import org.gitanimals.render.controller.response.PersonaResponse
import org.gitanimals.render.controller.response.UserResponse
import org.gitanimals.render.core.IdGenerator
import org.gitanimals.render.domain.PersonaType
import org.gitanimals.render.domain.UserService
import org.gitanimals.render.domain.request.PersonaChangeRequest
Expand Down Expand Up @@ -98,6 +100,30 @@ class PersonaController(
)
}

@PostMapping("/internals/personas/multiply")
fun addPersonaMultiple(
@RequestHeader(HttpHeaders.AUTHORIZATION) token: String,
@RequestBody addPersonaRequests: List<AddMultiplyPersonaRequest>,
): List<PersonaResponse> {
return addPersonaRequests.map {
val persona = userFacade.addPersona(
token,
it.idempotencyKey,
IdGenerator.generate(),
it.personaName,
0,
)

PersonaResponse(
persona.id,
persona.type,
persona.level,
persona.visible,
persona.dropRate,
)
}
}

@DeleteMapping("/internals/personas")
fun deletePersona(
@RequestHeader(HttpHeaders.AUTHORIZATION) token: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.gitanimals.render.controller.request

data class AddMultiplyPersonaRequest(
val idempotencyKey: String,
val personaName: String,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.gitanimals.render.domain.event

data class NewUserCreated(
val userId: Long,
val username: String,
) {
}

0 comments on commit 413d03a

Please sign in to comment.