Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

スクショ・各パスの役割・どういうアプリケーションか・キーになる関数 #1

Open
catatsuy opened this issue Oct 7, 2017 · 8 comments

Comments

@catatsuy
Copy link
Owner

commented Oct 7, 2017

No description provided.

@catatsuy

This comment has been minimized.

Copy link
Owner Author

commented Oct 21, 2017

チャットアプリ
image

投稿できる
image

@catatsuy

This comment has been minimized.

Copy link
Owner Author

commented Oct 21, 2017

チャンネル追加
image

プロフィール変更
image

@catatsuy

This comment has been minimized.

Copy link
Owner Author

commented Oct 21, 2017

チャンネルには未読数みたいなのが出ている

@catatsuy

This comment has been minimized.

Copy link
Owner Author

commented Oct 21, 2017

チャットログ。ページャーもある
image

@catatsuy

This comment has been minimized.

Copy link
Owner Author

commented Oct 21, 2017

ルーティング

	e.GET("/initialize", getInitialize)
	e.GET("/", getIndex)
	e.GET("/register", getRegister)
	e.POST("/register", postRegister)
	e.GET("/login", getLogin)
	e.POST("/login", postLogin)
	e.GET("/logout", getLogout)

	e.GET("/channel/:channel_id", getChannel)
	e.GET("/message", getMessage)
	e.POST("/message", postMessage)
	e.GET("/fetch", fetchUnread)
	e.GET("/history/:channel_id", getHistory)

	e.GET("/profile/:user_name", getProfile)
	e.POST("/profile", postProfile)

	e.GET("add_channel", getAddChannel)
	e.POST("add_channel", postAddChannel)
	e.GET("/icons/:file_name", getIcon)

	e.Start(":5000")
@catatsuy

This comment has been minimized.

Copy link
Owner Author

commented Oct 21, 2017

/fetch を1秒に1回程度リクエストをし続けている。未読数がjsonに入ってくる。

SELECT COUNT(*) as cnt FROM message WHERE channel_id = ? AND ? < id

とかを投げている

@catatsuy

This comment has been minimized.

Copy link
Owner Author

commented Oct 21, 2017

/getIcon

プロフィール画像がMySQLに入っている。

これは画像に吐き出したい

@catatsuy

This comment has been minimized.

Copy link
Owner Author

commented Oct 21, 2017

CREATE TABLE user (
  id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
  name VARCHAR(191) UNIQUE,
  salt VARCHAR(20),
  password VARCHAR(40),
  display_name TEXT,
  avatar_icon TEXT,
  created_at DATETIME NOT NULL
) Engine=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE image (
  id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
  name VARCHAR(191),
  data LONGBLOB
) Engine=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE channel (
  id BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY,
  name TEXT NOT NULL,
  description MEDIUMTEXT,
  updated_at DATETIME NOT NULL,
  created_at DATETIME NOT NULL
) Engine=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE message (
  id BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY,
  channel_id BIGINT,
  user_id BIGINT,
  content TEXT,
  created_at DATETIME NOT NULL
) Engine=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE haveread (
  user_id BIGINT NOT NULL,
  channel_id BIGINT NOT NULL,
  message_id BIGINT,
  updated_at DATETIME NOT NULL,
  created_at DATETIME NOT NULL,
  PRIMARY KEY(user_id, channel_id)
) Engine=InnoDB DEFAULT CHARSET=utf8mb4;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.