Skip to content

workshop content#15

Open
fsetiawan29 wants to merge 1 commit intotherizk:masterfrom
fsetiawan29:f_febry_workshop
Open

workshop content#15
fsetiawan29 wants to merge 1 commit intotherizk:masterfrom
fsetiawan29:f_febry_workshop

Conversation

@fsetiawan29
Copy link

No description provided.

type NilaiSiswa struct {
NIM int64 `json:"nim" db:"nim"`
MapelID int64 `json:"mapel_id" db:"mapel_id"`
Nilai int64 `json:"nili" db:"nili"`
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Nilai int64 `json:"nili" db:"nili"`
Nilai int64 `json:"nilai" db:"nilai"`

Kelas string `json:"kelas" db:"kelas"`
}

func GetNilaiSiswaByID(ctx context.Context, nim, mapel_id int64) (result []NilaiSiswa, err error) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disarankan pakai camel case ya jd bisa mapelID

Suggested change
func GetNilaiSiswaByID(ctx context.Context, nim, mapel_id int64) (result []NilaiSiswa, err error) {
func GetNilaiSiswaByID(ctx context.Context, nim, mapelID int64) (result []NilaiSiswa, err error) {


func (s *server) GetNilaiSiswa(ctx context.Context, req *pb.GetNilaiSiswaRequest) (resp *pb.GetNilaiSiswaResponse, err error) {

if req.sekolah == "" {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

krn req itu pointer, lebih enak kalau di cek dia nilai atau ga ya

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

di cek nil atau ga maksudnya hehe

"github.com/tokopedia/tokopoints/tracer"
)

func GetNilaiSiswa(ctx context.Context, nim int64, sekolah, kelas string, mapel_id int64) (resp GetNilaiSiswaResponse, err error) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kindly reminder buat mapel_id diubah jd mapelID ya

return resp, errors.AddTrace(err)
}

detailSekolah, err := nilai.GetDetailSekolah(ctx, nilai.Sekolah[0])
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mungkin bisa di cek length dari nilai.Sekolah ya takut panic pas get index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants