JUNI
@ydj90720740
Reviews Written
-
Average Rating
-
Posts
Q&A
TODO 2๋ฒ ๋ฌธ์
ํด๊ฒฐ๋์์ต๋๋ค ๊ฐ์ฌํฉ๋๋ค
- 1
- 4
- 101
Q&A
TODO 2๋ฒ ๋ฌธ์
(์ฌ์ง)#if 1xTaskCreate( (TaskFunction_t)Task1, /* Pointer to the function that implements the task. */"Task1", /* Text name for the task. This is to facilitate debugging only. */256, /* Stack depth - most small microcontrollers will use much less stack than this. */NULL, /* We are not using the task parameter. */TASK_1_PRIO, /* This task will run at this priority */&xHandle1 ); /* We are not using the task handle. */#endif // TODO #1 /* Create the other task in exactly the same way. */Param = &Param_Tbl; /* get parameter tbl addr */Param->P1 = 111111; /* set parameter */Param->P2 = 222222;#ifdef CMSIS_OSosThreadDef(Task2, (void const *)Task2, osPriorityBelowNormal, 0, 256);xHandle2 = osThreadCreate (osThread(Task2), (void*)Param);#elsexTaskCreate( (TaskFunction_t)Task2, "Task2", 256, (void*)Param, TASK_2_PRIO, &xHandle2 );#endif /* TODO #2:Task1์ ์ค์งuse 'vTaskSuspend' */#if 1vTaskSuspend(xHandle1);#endif // TODO #2๋ค์๊ณผ ๊ฐ์ด xHandle1์ suspend ํ์์๋ ๋ถ๊ตฌํ๊ณ task2๊ฐ ์คํ์ด ์๋๊ณ ์์ต๋๋ค.์ค์ ์ ๊ฐ์ ํฌํธ ํ๋ก์ ํธ ์ค์ ๊ณผ ๋๊ฐ์ด ํ์์ต๋๋ค.
- 1
- 4
- 101
Q&A
authentication server ํ ํฐ ๊ฒ์ฆ api ํ ์คํธ ์ง๋ฌธ
anonymoususer ํด๊ฒฐ ๋ฐฉ๋ฒ์ ์ด๋ป๊ฒ ๋๋์?token์์ ์ต๋ช ์ฌ์ฉ์๋ก ํ์ธ์ด ๋๋ค๋๋ฐ, ํด๋น ๋ถ๋ถ ๊ด๋ จ๋์๋ ์ ๊ฐ ์ค์ ์ ํ์ง ์๋ ๋ถ๋ถ์ด ์์๊น์? ์ถ๊ฐ์ ์ผ๋ก ๊ถํ์ ์ฐพ์ง ๋ชปํ๋ ์ด์ ๋ก๋ClientSecretPostAuthenticationConverter์์ ํด๋นํ๋ ํ๋ผ๋ฏธํฐ๊ฐ ์์ด์ ๋ฐ์ํ๋ ๋ฌธ์ ๋ก ๋ณด์ ๋๋ค. ClientSecretPostAuthenticationConverter๊ฐ ์๋ ๋ค๋ฅธ ์ค์ ์ ํ๋์ง ์ง๋ฌธ๋๋ฆฝ๋๋ค. (๊ฐ์ ๋ด์ฉ๊ณผ ๊ฐ์ ๋ฒ์ ์ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.) (์ฌ์ง)๊ฐ์ํ๊ณ ๋ค๋ฅด๊ฒ ํ๋ผ๋ฏธํฐ๋ฅผ ๋ฃ์์ ๊ฒฝ์ฐ์๋ ํด๊ฒฐ์ด ๋์์ต๋๋ค.
- 1
- 2
- 185
Q&A
rsa 512 ๋ณตํธํ ์๋ฌ
@Bean public RSAKey rsaKey() throws JOSEException { return new RSAKeyGenerator(2048) .keyID("rsaKey") .algorithm(JWSAlgorithm.RS256) .generate(); }ํด๋นํ๋ ์ค์ ์ ๋ณ๊ฒฝ์ ํ์ง ์์์ ๋ฐ์ํ ๋ฌธ์ ์์ต๋๋ค.ํน์, ์ ๊ฐ ๋น ๋จ๋ฆฐ ๋ด์ฉ์ด ์์๊น์?rsaKeyGenerator algorithm์ ์๋์ผ๋ก ๋ฑ๋กํ๊ธฐ ์ํด OAuth2ResourceServerJwtConfiguration์ ์๋ properties ๊ฐ์ ๊ฐ์ง๊ณ ์์ ๋ฑ๋กํ๋ ๋ฐฉ๋ฒ์ ์ฌ์ฉํด์ผ๋ ๊น์?- ํด๋น๋ ๋ด์ฉ๋ properties ์ค์ ์์ ๊ฐ์ ธ์ค๋ฉด ์ข๊ฒ ๋ค๋ ์๊ฐ์ด ๋ค์ด์ง๋ฌธ๋๋ฆฝ๋๋ค.
- 0
- 2
- 190
Q&A
OAuth2 form login error
(์ฌ์ง)์ถ๊ฐ์ ์ผ๋ก authentication์ ๊ฐ์ด credentials๊ฐ ๋น๊ฐ์ผ๋ก ์ค๋ฉฐ, String presentedPassword = authentication.getCredentials().toString(); ํด๋น์ฝ๋๋ฅผ ํตํด ๊ฐ์ด ๋น๊ฐ์ด๋ผ์ ๊ฐ์ด ์๋ ์ํฉ์ ๋๋ค.presentedPassword = ""userDetails.getPassword() = "{noop}1234"์ ๋๋ค.(์ฌ์ง)
- 0
- 2
- 223
Q&A
needToCatchEvent ์ค๋ฅ
๋ค ๋๋ฒ๊น ํ๋ฉด์ logs๊ฐ ์๋ค์ด์ค๋ ๊ฒ๊น์ง ํ์ธ์ ํ์ต๋๋ค.๊ทธ๋ฐ๋ฐ ์ด๋ ๋ถํฐ ์๋ชป๋๋์ง ํ์ธ์ด ๋ถ๊ฐ๋ฅํฉ๋๋ค.ํน์ git์ ์์ค์ฝ๋ ๊ณต์ ๋ถํ๋๋ ค๋ ๋ ๊น์?package event import ( "context" "event/config" "fmt" "math/big" "time" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" ethType "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" ) type Scan struct { config *config.Config FilterQuery ethereum.FilterQuery client *ethclient.Client } func NewScan(config *config.Config, client *ethclient.Client, catchEventList []common.Hash) (*Scan, chan []ethType.Log, error) { s := &Scan{ config: config, client: client, } eventLog := make(chan []ethType.Log, 100) scanCallection := common.HexToAddress("0x97D6Aba16E92d82A58519C452c006e4058A631D7") go s.lookingScan(config.Node.StartBlock, scanCallection, catchEventList, eventLog) return s, eventLog, nil } //44961870 // ๋ฐฐํฌ : 44961732 func (s *Scan) lookingScan(startBlock int64, scanCallection common.Address, catchEventList []common.Hash, eventLog chan uint64(startBlock) { fmt.Println("from Block", s.FilterQuery.ToBlock, "to Block", to) s.FilterQuery.ToBlock = big.NewInt(int64(to)) s.FilterQuery.FromBlock = big.NewInt(startReadtBlock) tryCount := 1 fmt.Println("s.FilterQuery : ", s.FilterQuery) Retry: if logs, err := s.client.FilterLogs(ctx, s.FilterQuery); err != nil { if tryCount == 3 { fmt.Println("failed to get Filter", "err", err.Error()) break } else { newTo := big.NewInt(int64(to) - 1) newFrom := big.NewInt(startBlock - 1) s.FilterQuery.ToBlock = newTo s.FilterQuery.FromBlock = newFrom tryCount++ goto Retry } } else if len(logs) > 0 { eventLog s.FilterQuery : { 44961732 52617540 [0x97D6Aba16E92d82A58519C452c006e4058A631D7] [[0xd99659a21de82e379975ce8df556f939a4ccb95e92144f38bb0dd35730ffcdd5]]}from Block 52617540 to Block 52617540s.FilterQuery : { 44961732 52617540 [0x97D6Aba16E92d82A58519C452c006e4058A631D7] [[0xd99659a21de82e379975ce8df556f939a4ccb95e92144f38bb0dd35730ffcdd5]]}from Block 52617540 to Block 52617541s.FilterQuery : { 44961732 52617541 [0x97D6Aba16E92d82A58519C452c006e4058A631D7] [[0xd99659a21de82e379975ce8df556f939a4ccb95e92144f38bb0dd35730ffcdd5]]}from Block 52617541 to Block 52617541s.FilterQuery : { 44961732 52617541 [0x97D6Aba16E92d82A58519C452c006e4058A631D7] [[0xd99659a21de82e379975ce8df556f939a4ccb95e92144f38bb0dd35730ffcdd5]]}from Block 52617541 to Block 52617542s.FilterQuery : { 44961732 52617542 [0x97D6Aba16E92d82A58519C452c006e4058A631D7] [[0xd99659a21de82e379975ce8df556f939a4ccb95e92144f38bb0dd35730ffcdd5]]}from Block 52617542 to Block 52617542s.FilterQuery : { 44961732 52617542 [0x97D6Aba16E92d82A58519C452c006e4058A631D7] [[0xd99659a21de82e379975ce8df556f939a4ccb95e92144f38bb0dd35730ffcdd5]]}exit status 0xc000013as.FilterQuery๋ ์ ๋ค์ด์ค๊ณ ์๋๊ฒ ๊ฐ์๋ฐ nil์ ์ ์์ ์ธ๊ฑฐ์ฃ ?
- 0
- 3
- 413
Q&A
needToCatchEvent ์ค๋ฅ
package event import ( "context" "event/config" "event/types" "fmt" "github.com/ethereum/go-ethereum/common" ethType "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethclient" ) type Catch struct { config *config.Config client *ethclient.Client needToCatchEvent map[common.Hash]types.NeedToCatchEvent } func NewCatch(config *config.Config, client *ethclient.Client) (*Catch, error) { c := &Catch{ config: config, client: client, } c.needToCatchEvent = map[common.Hash]types.NeedToCatchEvent{ common.BytesToHash(crypto.Keccak256([]byte("Transfer(address,address,uint256"))): { NeedToCatchEventFunc: c.Transfer, }, } return c, nil } func (c *Catch) Transfer(e *ethType.Log, tx *ethType.Transaction) { fmt.Println("๋ค์ด ์์ต๋๋ค.") } // start To Catch Event func (c *Catch) StartToCatch(events package app import ( "event/config" "event/event" repostory "event/repository" ethType "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" ) type App struct { config *config.Config client *ethclient.Client repostory *repostory.Repostory scan *event.Scan catch *event.Catch } func NewApp(config *config.Config) { a := App{ config: config, } var err error if a.client, err = ethclient.Dial(config.Node.Uri); err != nil { panic(err) } else { if a.repostory, err = repostory.NewRepostory(config); err != nil { panic(err) } if a.catch, err = event.NewCatch(config, a.client); err != nil { panic(err) } var eventChan chan []ethType.Log if a.scan, eventChan, err = event.NewScan(config, a.client, a.catch.GetEventsToCatch()); err != nil { panic(err) } go a.catch.StartToCatch(eventChan) for { } } } ์๋ฌ ์ฝ๋๋ ์์์ต๋๋ค.ํธ๋์ญ์ ์ ์ ์กํ์ จ๋์ง ์ง๋ฌธ์ ๋๋ ธ๋๋ฐ?mumbai์ ํธ๋์ญ์ ์ ๋ง์ํ์ ๊ฑด๊ฐ์? => ํ ์คํธ๋ท์์ 0x9f878a0a73a53dd676d4f9ec58b823ab9130df335c8b38b4df8ac2d15f49adee ๊ฒ์ํ ์ ์๋ ํธ๋์ญ์ ํด์ฌ ์ฝ๋ ์ ๋๋ค.์คํ ํ์๋์ ๋ก๊ทธ์ ๋๋ค,Event๊ฐ ๋ค์ด ์์ต๋๋ค.from Block to Block 52533290from Block 52533290 to Block 52533290from Block 52533290 to Block 52533291exit status 0xc000013a
- 0
- 3
- 413
Q&A
create ์์ฒญ์ ์๋ฌ
func (u *userRouter) create(c *gin.Context) { fmt.Println("create ์ ๋๋ค") var req types.CreateRequest if err := c.ShouldBindJSON(&req); err != nil { u.router.failedResponse(c, &types.CreateUserResponse{ ApiResponse: types.NewApiResponse(-1, "๋ฐ์ธ๋ฉ ์ค๋ฅ", err), }) } else if err := u.userService.Create(req.ToUser()); err != nil { u.router.failedResponse(c, &types.CreateUserResponse{ ApiResponse: types.NewApiResponse(-1, "๋ฐ์ธ๋ฉ ์ค๋ฅ", err), }) } else { u.router.okResponse(c, &types.CreateUserResponse{ ApiResponse: types.NewApiResponse(1, "์ฑ๊ณต ์ ๋๋ค.", err), }) } package typestype ApiResponse struct { Result int64 json:"result" Description string json:"description" ErrCode interface{} json:"errCode"}func NewApiResponse(Result int64, Description string, errCode interface{}) *ApiResponse { return &ApiResponse{ Result: Result, Description: Description, ErrCode: errCode, }} package typestype User struct { Name string json:"name" Age int64 json:"age"}type CreateUserResponse struct { *ApiResponse}type CreateRequest struct { Name string json:"name" binding:"require" Age int64 json:"age" binding:"require"}func (c CreateRequest) ToUser() User { return &User{ Name: c.Name, Age: c.Age, }}type GetUserResponse struct { *ApiResponse Users []*User json:result}type UpdateUserResponse struct { *ApiResponse}type UpdateRequest struct { Name string json:"name" binding:"require" UpdateAge int64 json:"updateAge" binding:"require"}type DeleteUserResponse struct { *ApiResponse}type DeleteRequest struct { Name string json:"name" binding:"require"}func (c DeleteRequest) ToUser() User { return &User{ Name: c.Name, }} ์ด๋ ๊ฒ ๋๋๋ฐ if err := c.ShouldBindJSON(&req); err != nil { ์ฌ๊ธฐ์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๋ค๊ณ ํฉ๋๋ค. ์ด์ ๋ฅผ ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค.
- 0
- 2
- 385
Q&A
nosuchfile
https://github.com/yundongjun/untitled ๊ด๋ จ ํ์ผ ์ ๋๋ค.
- 0
- 1
- 311
Q&A
๋น๋์นญํค jwt ์ธ์ฆ ๋ฌธ์
๊ด๋ จ ๋ด์ฉ์์ ๊ณ์ ์๋์ ์ง๋ฌธ ๋๋ฆฝ๋๋ค.
- 0
- 4
- 608




